Skip to content

Commit

Permalink
Merge branch 'MDL-45239-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Apr 30, 2014
2 parents 4b1e2c5 + 05a7f9e commit da8a720
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Expand Up @@ -1001,6 +1001,11 @@ EditorSelection.prototype = {
return false;
}

// We can't be active if the editor doesn't have focus at the moment.
if (!document.activeElement || document.activeElement !== this.editor) {
return false;
}

// Check whether the range intersects the editor selection.
range.selectNode(this.editor.getDOMNode());
return range.intersectsRange(selection.getRangeAt(0));
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -996,6 +996,11 @@ EditorSelection.prototype = {
return false;
}

// We can't be active if the editor doesn't have focus at the moment.
if (!document.activeElement || document.activeElement !== this.editor) {
return false;
}

// Check whether the range intersects the editor selection.
range.selectNode(this.editor.getDOMNode());
return range.intersectsRange(selection.getRangeAt(0));
Expand Down
5 changes: 5 additions & 0 deletions lib/editor/atto/yui/src/editor/js/selection.js
Expand Up @@ -108,6 +108,11 @@ EditorSelection.prototype = {
return false;
}

// We can't be active if the editor doesn't have focus at the moment.
if (!document.activeElement || document.activeElement !== this.editor) {
return false;
}

// Check whether the range intersects the editor selection.
range.selectNode(this.editor.getDOMNode());
return range.intersectsRange(selection.getRangeAt(0));
Expand Down

0 comments on commit da8a720

Please sign in to comment.