Merge branch 'MDL-52825_master-fix' of git://github.com/dmonllao/moodle
This commit is contained in:
+21
-8
@@ -1919,6 +1919,16 @@ EditorSelection.prototype = {
|
||||
*/
|
||||
_focusFromClick: false,
|
||||
|
||||
/**
|
||||
* Whether if the last gesturemovestart event target was contained in this editor or not.
|
||||
*
|
||||
* @property _gesturestartededitor
|
||||
* @type Boolean
|
||||
* @default false
|
||||
* @private
|
||||
*/
|
||||
_gesturestartededitor: false,
|
||||
|
||||
/**
|
||||
* Set up the watchers for selection save and restoration.
|
||||
*
|
||||
@@ -1949,18 +1959,21 @@ EditorSelection.prototype = {
|
||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||
}, this);
|
||||
|
||||
// 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.
|
||||
this.editor.on('gesturemoveend', function(e) {
|
||||
Y.one(document.body).on('gesturemovestart', function(e) {
|
||||
if (this._wrapper.contains(e.target._node)) {
|
||||
this._gesturestartededitor = true;
|
||||
} else {
|
||||
this._gesturestartededitor = false;
|
||||
}
|
||||
}, null, this);
|
||||
|
||||
// Ignore the event if the target is not part of the current editor.
|
||||
if (!this._wrapper.contains(e.target._node)) {
|
||||
Y.one(document.body).on('gesturemoveend', function(e) {
|
||||
if (!this._gesturestartededitor) {
|
||||
// Ignore the event if movestart target was not contained in the editor.
|
||||
return;
|
||||
}
|
||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||
}, {
|
||||
standAlone: true
|
||||
}, this);
|
||||
}, null, this);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+21
-8
@@ -1906,6 +1906,16 @@ EditorSelection.prototype = {
|
||||
*/
|
||||
_focusFromClick: false,
|
||||
|
||||
/**
|
||||
* Whether if the last gesturemovestart event target was contained in this editor or not.
|
||||
*
|
||||
* @property _gesturestartededitor
|
||||
* @type Boolean
|
||||
* @default false
|
||||
* @private
|
||||
*/
|
||||
_gesturestartededitor: false,
|
||||
|
||||
/**
|
||||
* Set up the watchers for selection save and restoration.
|
||||
*
|
||||
@@ -1936,18 +1946,21 @@ EditorSelection.prototype = {
|
||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||
}, this);
|
||||
|
||||
// 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.
|
||||
this.editor.on('gesturemoveend', function(e) {
|
||||
Y.one(document.body).on('gesturemovestart', function(e) {
|
||||
if (this._wrapper.contains(e.target._node)) {
|
||||
this._gesturestartededitor = true;
|
||||
} else {
|
||||
this._gesturestartededitor = false;
|
||||
}
|
||||
}, null, this);
|
||||
|
||||
// Ignore the event if the target is not part of the current editor.
|
||||
if (!this._wrapper.contains(e.target._node)) {
|
||||
Y.one(document.body).on('gesturemoveend', function(e) {
|
||||
if (!this._gesturestartededitor) {
|
||||
// Ignore the event if movestart target was not contained in the editor.
|
||||
return;
|
||||
}
|
||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||
}, {
|
||||
standAlone: true
|
||||
}, this);
|
||||
}, null, this);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
+21
-8
@@ -64,6 +64,16 @@ EditorSelection.prototype = {
|
||||
*/
|
||||
_focusFromClick: false,
|
||||
|
||||
/**
|
||||
* Whether if the last gesturemovestart event target was contained in this editor or not.
|
||||
*
|
||||
* @property _gesturestartededitor
|
||||
* @type Boolean
|
||||
* @default false
|
||||
* @private
|
||||
*/
|
||||
_gesturestartededitor: false,
|
||||
|
||||
/**
|
||||
* Set up the watchers for selection save and restoration.
|
||||
*
|
||||
@@ -94,18 +104,21 @@ EditorSelection.prototype = {
|
||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||
}, this);
|
||||
|
||||
// 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.
|
||||
this.editor.on('gesturemoveend', function(e) {
|
||||
Y.one(document.body).on('gesturemovestart', function(e) {
|
||||
if (this._wrapper.contains(e.target._node)) {
|
||||
this._gesturestartededitor = true;
|
||||
} else {
|
||||
this._gesturestartededitor = false;
|
||||
}
|
||||
}, null, this);
|
||||
|
||||
// Ignore the event if the target is not part of the current editor.
|
||||
if (!this._wrapper.contains(e.target._node)) {
|
||||
Y.one(document.body).on('gesturemoveend', function(e) {
|
||||
if (!this._gesturestartededitor) {
|
||||
// Ignore the event if movestart target was not contained in the editor.
|
||||
return;
|
||||
}
|
||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||
}, {
|
||||
standAlone: true
|
||||
}, this);
|
||||
}, null, this);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user