mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-45253 editor_atto: Prevent selection of all nodes when selection is empty
This commit is contained in:
parent
d78920bdba
commit
e988383645
@ -1145,8 +1145,12 @@ EditorSelection.prototype = {
|
||||
}
|
||||
|
||||
if (range.collapsed) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
// 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()) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
}
|
||||
}
|
||||
|
||||
nodes = range.getNodes();
|
||||
|
File diff suppressed because one or more lines are too long
@ -1140,8 +1140,12 @@ EditorSelection.prototype = {
|
||||
}
|
||||
|
||||
if (range.collapsed) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
// 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()) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
}
|
||||
}
|
||||
|
||||
nodes = range.getNodes();
|
||||
|
@ -252,8 +252,12 @@ EditorSelection.prototype = {
|
||||
}
|
||||
|
||||
if (range.collapsed) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
// 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()) {
|
||||
range = range.cloneRange();
|
||||
range.selectNode(range.commonAncestorContainer);
|
||||
}
|
||||
}
|
||||
|
||||
nodes = range.getNodes();
|
||||
|
Loading…
x
Reference in New Issue
Block a user