mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-45468 editor_atto: Check that the common ancestor is within the editor
Conflicts: lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
This commit is contained in:
parent
18b12e7b60
commit
17f253faeb
@ -1175,7 +1175,10 @@ EditorSelection.prototype = {
|
||||
if (range.collapsed) {
|
||||
// We do not want to select all the nodes in the editor if we managed to
|
||||
// have a collapsed selection directly in the editor.
|
||||
if (range.commonAncestorContainer !== this.editor.getDOMNode()) {
|
||||
// It's also possible for the commonAncestorContainer to be the document, which selectNode does not handle
|
||||
// so we must filter that out here too.
|
||||
if (range.commonAncestorContainer !== this.editor.getDOMNode()
|
||||
&& range.commonAncestorContainer !== Y.config.doc) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1170,7 +1170,10 @@ EditorSelection.prototype = {
|
||||
if (range.collapsed) {
|
||||
// We do not want to select all the nodes in the editor if we managed to
|
||||
// have a collapsed selection directly in the editor.
|
||||
if (range.commonAncestorContainer !== this.editor.getDOMNode()) {
|
||||
// It's also possible for the commonAncestorContainer to be the document, which selectNode does not handle
|
||||
// so we must filter that out here too.
|
||||
if (range.commonAncestorContainer !== this.editor.getDOMNode()
|
||||
&& range.commonAncestorContainer !== Y.config.doc) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
}
|
||||
|
@ -272,7 +272,10 @@ EditorSelection.prototype = {
|
||||
if (range.collapsed) {
|
||||
// We do not want to select all the nodes in the editor if we managed to
|
||||
// have a collapsed selection directly in the editor.
|
||||
if (range.commonAncestorContainer !== this.editor.getDOMNode()) {
|
||||
// It's also possible for the commonAncestorContainer to be the document, which selectNode does not handle
|
||||
// so we must filter that out here too.
|
||||
if (range.commonAncestorContainer !== this.editor.getDOMNode()
|
||||
&& range.commonAncestorContainer !== Y.config.doc) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user