mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Bookmarking must not uncollapse a range.
This commit is contained in:
parent
0d706180fe
commit
110568350b
1 changed files with 4 additions and 6 deletions
|
@ -219,12 +219,6 @@ document.addEventListener( 'DOMContentLoaded', function () {
|
||||||
endNode = temp;
|
endNode = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure there's at least a text node in the selection
|
|
||||||
if ( startNode.nextSibling === endNode ) {
|
|
||||||
endNode.parentNode.insertBefore(
|
|
||||||
doc.createTextNode( '' ), endNode );
|
|
||||||
}
|
|
||||||
|
|
||||||
range.setStartAfter( startNode );
|
range.setStartAfter( startNode );
|
||||||
range.setEndBefore( endNode );
|
range.setEndBefore( endNode );
|
||||||
};
|
};
|
||||||
|
@ -264,6 +258,10 @@ document.addEventListener( 'DOMContentLoaded', function () {
|
||||||
}
|
}
|
||||||
range.setStart( _range.startContainer, _range.startOffset );
|
range.setStart( _range.startContainer, _range.startOffset );
|
||||||
range.setEnd( _range.endContainer, _range.endOffset );
|
range.setEnd( _range.endContainer, _range.endOffset );
|
||||||
|
|
||||||
|
if ( !range.collapsed ) {
|
||||||
|
range.moveBoundariesDownTree();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return range;
|
return range;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue