mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-52944 atto: Use event-key to handle enter key
This commit is contained in:
parent
92a8ca4ba2
commit
a6a59bcaa4
5 changed files with 16 additions and 19 deletions
|
@ -294,11 +294,9 @@ Y.extend(Editor, Y.Base, {
|
||||||
*/
|
*/
|
||||||
setupAutomaticPolling: function() {
|
setupAutomaticPolling: function() {
|
||||||
// Force use of <p> tags when pressing enter key
|
// Force use of <p> tags when pressing enter key
|
||||||
this._registerEventHandle(this.editor.on('keypress', function(ev) {
|
this._registerEventHandle(this.editor.on('key', function() {
|
||||||
if(ev.keyCode === 13) {
|
document.execCommand('formatBlock', false, 'p');
|
||||||
document.execCommand('formatBlock', false, 'p');
|
}, 'press:enter', this));
|
||||||
}
|
|
||||||
}, this));
|
|
||||||
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
||||||
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
||||||
|
|
||||||
|
@ -2585,6 +2583,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorFilepicker]);
|
||||||
"overlay",
|
"overlay",
|
||||||
"escape",
|
"escape",
|
||||||
"event",
|
"event",
|
||||||
|
"event-key",
|
||||||
"event-simulate",
|
"event-simulate",
|
||||||
"event-custom",
|
"event-custom",
|
||||||
"node-event-html5",
|
"node-event-html5",
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -292,11 +292,9 @@ Y.extend(Editor, Y.Base, {
|
||||||
*/
|
*/
|
||||||
setupAutomaticPolling: function() {
|
setupAutomaticPolling: function() {
|
||||||
// Force use of <p> tags when pressing enter key
|
// Force use of <p> tags when pressing enter key
|
||||||
this._registerEventHandle(this.editor.on('keypress', function(ev) {
|
this._registerEventHandle(this.editor.on('key', function() {
|
||||||
if(ev.keyCode === 13) {
|
document.execCommand('formatBlock', false, 'p');
|
||||||
document.execCommand('formatBlock', false, 'p');
|
}, 'press:enter', this));
|
||||||
}
|
|
||||||
}, this));
|
|
||||||
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
||||||
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
||||||
|
|
||||||
|
@ -2572,6 +2570,7 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorFilepicker]);
|
||||||
"overlay",
|
"overlay",
|
||||||
"escape",
|
"escape",
|
||||||
"event",
|
"event",
|
||||||
|
"event-key",
|
||||||
"event-simulate",
|
"event-simulate",
|
||||||
"event-custom",
|
"event-custom",
|
||||||
"node-event-html5",
|
"node-event-html5",
|
||||||
|
|
8
lib/editor/atto/yui/src/editor/js/editor.js
vendored
8
lib/editor/atto/yui/src/editor/js/editor.js
vendored
|
@ -292,11 +292,9 @@ Y.extend(Editor, Y.Base, {
|
||||||
*/
|
*/
|
||||||
setupAutomaticPolling: function() {
|
setupAutomaticPolling: function() {
|
||||||
// Force use of <p> tags when pressing enter key
|
// Force use of <p> tags when pressing enter key
|
||||||
this._registerEventHandle(this.editor.on('keypress', function(ev) {
|
this._registerEventHandle(this.editor.on('key', function() {
|
||||||
if(ev.keyCode === 13) {
|
document.execCommand('formatBlock', false, 'p');
|
||||||
document.execCommand('formatBlock', false, 'p');
|
}, 'press:enter', this));
|
||||||
}
|
|
||||||
}, this));
|
|
||||||
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
this._registerEventHandle(this.editor.on(['keyup', 'cut'], this.updateOriginal, this));
|
||||||
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
this._registerEventHandle(this.editor.on('paste', this.pasteCleanup, this));
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"overlay",
|
"overlay",
|
||||||
"escape",
|
"escape",
|
||||||
"event",
|
"event",
|
||||||
|
"event-key",
|
||||||
"event-simulate",
|
"event-simulate",
|
||||||
"event-custom",
|
"event-custom",
|
||||||
"node-event-html5",
|
"node-event-html5",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue