mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16:42 +02:00
MDL-52825 atto: Ignore out of bounds event targets
This commit is contained in:
parent
e8d5100212
commit
923589d759
4 changed files with 29 additions and 14 deletions
|
@ -1952,6 +1952,11 @@ EditorSelection.prototype = {
|
||||||
// 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.
|
||||||
this.editor.on('gesturemoveend', function(e) {
|
this.editor.on('gesturemoveend', function(e) {
|
||||||
|
|
||||||
|
// Ignore the event if the target is not part of the current editor.
|
||||||
|
if (!this._wrapper.contains(e.target._node)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, {
|
}, {
|
||||||
standAlone: true
|
standAlone: true
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1939,6 +1939,11 @@ EditorSelection.prototype = {
|
||||||
// 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.
|
||||||
this.editor.on('gesturemoveend', function(e) {
|
this.editor.on('gesturemoveend', function(e) {
|
||||||
|
|
||||||
|
// Ignore the event if the target is not part of the current editor.
|
||||||
|
if (!this._wrapper.contains(e.target._node)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, {
|
}, {
|
||||||
standAlone: true
|
standAlone: true
|
||||||
|
|
|
@ -97,6 +97,11 @@ EditorSelection.prototype = {
|
||||||
// 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.
|
||||||
this.editor.on('gesturemoveend', function(e) {
|
this.editor.on('gesturemoveend', function(e) {
|
||||||
|
|
||||||
|
// Ignore the event if the target is not part of the current editor.
|
||||||
|
if (!this._wrapper.contains(e.target._node)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
Y.soon(Y.bind(this._hasSelectionChanged, this, e));
|
||||||
}, {
|
}, {
|
||||||
standAlone: true
|
standAlone: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue