MDL-48064 atto_editor: Expand event subscription for saving selection

This commit is contained in:
Daniel Thies 2014-11-17 11:15:45 -06:00
parent 9b9a3abf9b
commit 8bca3609ee
4 changed files with 13 additions and 13 deletions

View file

@ -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

View file

@ -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);

View file

@ -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);