MDL-52944 atto: Use event-key to handle enter key
This commit is contained in:
+4
-5
@@ -294,11 +294,9 @@ Y.extend(Editor, Y.Base, {
|
||||
*/
|
||||
setupAutomaticPolling: function() {
|
||||
// Force use of <p> tags when pressing enter key
|
||||
this._registerEventHandle(this.editor.on('keypress', function(ev) {
|
||||
if(ev.keyCode === 13) {
|
||||
document.execCommand('formatBlock', false, 'p');
|
||||
}
|
||||
}, this));
|
||||
this._registerEventHandle(this.editor.on('key', function() {
|
||||
document.execCommand('formatBlock', false, 'p');
|
||||
}, 'press:enter', this));
|
||||
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
||||
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
||||
|
||||
@@ -2585,6 +2583,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorFilepicker]);
|
||||
"overlay",
|
||||
"escape",
|
||||
"event",
|
||||
"event-key",
|
||||
"event-simulate",
|
||||
"event-custom",
|
||||
"node-event-html5",
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
+4
-5
@@ -292,11 +292,9 @@ Y.extend(Editor, Y.Base, {
|
||||
*/
|
||||
setupAutomaticPolling: function() {
|
||||
// Force use of <p> tags when pressing enter key
|
||||
this._registerEventHandle(this.editor.on('keypress', function(ev) {
|
||||
if(ev.keyCode === 13) {
|
||||
document.execCommand('formatBlock', false, 'p');
|
||||
}
|
||||
}, this));
|
||||
this._registerEventHandle(this.editor.on('key', function() {
|
||||
document.execCommand('formatBlock', false, 'p');
|
||||
}, 'press:enter', this));
|
||||
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
||||
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
||||
|
||||
@@ -2572,6 +2570,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorFilepicker]);
|
||||
"overlay",
|
||||
"escape",
|
||||
"event",
|
||||
"event-key",
|
||||
"event-simulate",
|
||||
"event-custom",
|
||||
"node-event-html5",
|
||||
|
||||
+3
-5
@@ -292,11 +292,9 @@ Y.extend(Editor, Y.Base, {
|
||||
*/
|
||||
setupAutomaticPolling: function() {
|
||||
// Force use of <p> tags when pressing enter key
|
||||
this._registerEventHandle(this.editor.on('keypress', function(ev) {
|
||||
if(ev.keyCode === 13) {
|
||||
document.execCommand('formatBlock', false, 'p');
|
||||
}
|
||||
}, this));
|
||||
this._registerEventHandle(this.editor.on('key', function() {
|
||||
document.execCommand('formatBlock', false, 'p');
|
||||
}, 'press:enter', this));
|
||||
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
||||
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"overlay",
|
||||
"escape",
|
||||
"event",
|
||||
"event-key",
|
||||
"event-simulate",
|
||||
"event-custom",
|
||||
"node-event-html5",
|
||||
|
||||
Reference in New Issue
Block a user