MDL-48064 atto_editor: Check if activeElement is child node in isActive

This commit is contained in:
Daniel Thies
2014-11-14 11:49:15 -06:00
parent c106341098
commit 9b9a3abf9b
4 changed files with 7 additions and 4 deletions
@@ -1535,7 +1535,8 @@ EditorSelection.prototype = {
}
// We can't be active if the editor doesn't have focus at the moment.
if (!document.activeElement || Y.one(document.activeElement) !== this.editor) {
if (!document.activeElement ||
!(this.editor.compareTo(document.activeElement) || this.editor.contains(document.activeElement))) {
return false;
}
File diff suppressed because one or more lines are too long
@@ -1523,7 +1523,8 @@ EditorSelection.prototype = {
}
// We can't be active if the editor doesn't have focus at the moment.
if (!document.activeElement || Y.one(document.activeElement) !== this.editor) {
if (!document.activeElement ||
!(this.editor.compareTo(document.activeElement) || this.editor.contains(document.activeElement))) {
return false;
}
+2 -1
View File
@@ -121,7 +121,8 @@ EditorSelection.prototype = {
}
// We can't be active if the editor doesn't have focus at the moment.
if (!document.activeElement || Y.one(document.activeElement) !== this.editor) {
if (!document.activeElement ||
!(this.editor.compareTo(document.activeElement) || this.editor.contains(document.activeElement))) {
return false;
}