mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-48064 atto_editor: Expand event subscription for saving selection
This commit is contained in:
parent
9b9a3abf9b
commit
8bca3609ee
4 changed files with 13 additions and 13 deletions
|
@ -1504,15 +1504,15 @@ EditorSelection.prototype = {
|
||||||
this.updateOriginal();
|
this.updateOriginal();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
Y.delegate(['keyup', 'focus', 'mouseleave'], function(e) {
|
this.editor.on(['keyup', 'focus'], function(e) {
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, document.body, '#' + this.editor.get('id'), this);
|
}, this);
|
||||||
|
|
||||||
// To capture both mouseup and touchend events, we need to track the gesturemoveend event in standAlone mode. Without
|
// To capture both mouseup and touchend events, we need to track the gesturemoveend event in standAlone mode. Without
|
||||||
// standAlone, it will only fire if we listened to a gesturemovestart too.
|
// standAlone, it will only fire if we listened to a gesturemovestart too.
|
||||||
Y.delegate('gesturemoveend', function(e) {
|
this.editor.on('gesturemoveend', function(e) {
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, document.body, '#' + this.editor.get('id'), {
|
}, {
|
||||||
standAlone: true
|
standAlone: true
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1492,15 +1492,15 @@ EditorSelection.prototype = {
|
||||||
this.updateOriginal();
|
this.updateOriginal();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
Y.delegate(['keyup', 'focus', 'mouseleave'], function(e) {
|
this.editor.on(['keyup', 'focus'], function(e) {
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, document.body, '#' + this.editor.get('id'), this);
|
}, this);
|
||||||
|
|
||||||
// To capture both mouseup and touchend events, we need to track the gesturemoveend event in standAlone mode. Without
|
// To capture both mouseup and touchend events, we need to track the gesturemoveend event in standAlone mode. Without
|
||||||
// standAlone, it will only fire if we listened to a gesturemovestart too.
|
// standAlone, it will only fire if we listened to a gesturemovestart too.
|
||||||
Y.delegate('gesturemoveend', function(e) {
|
this.editor.on('gesturemoveend', function(e) {
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, document.body, '#' + this.editor.get('id'), {
|
}, {
|
||||||
standAlone: true
|
standAlone: true
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
|
|
@ -90,15 +90,15 @@ EditorSelection.prototype = {
|
||||||
this.updateOriginal();
|
this.updateOriginal();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
Y.delegate(['keyup', 'focus', 'mouseleave'], function(e) {
|
this.editor.on(['keyup', 'focus'], function(e) {
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, document.body, '#' + this.editor.get('id'), this);
|
}, this);
|
||||||
|
|
||||||
// To capture both mouseup and touchend events, we need to track the gesturemoveend event in standAlone mode. Without
|
// To capture both mouseup and touchend events, we need to track the gesturemoveend event in standAlone mode. Without
|
||||||
// standAlone, it will only fire if we listened to a gesturemovestart too.
|
// standAlone, it will only fire if we listened to a gesturemovestart too.
|
||||||
Y.delegate('gesturemoveend', function(e) {
|
this.editor.on('gesturemoveend', function(e) {
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, document.body, '#' + this.editor.get('id'), {
|
}, {
|
||||||
standAlone: true
|
standAlone: true
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue