0
Fork 0
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:
Neil Jenkins 2011-11-02 10:45:33 +11:00
parent 0d706180fe
commit 110568350b

View file

@ -219,12 +219,6 @@ document.addEventListener( 'DOMContentLoaded', function () {
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.setEndBefore( endNode );
};
@ -264,6 +258,10 @@ document.addEventListener( 'DOMContentLoaded', function () {
}
range.setStart( _range.startContainer, _range.startOffset );
range.setEnd( _range.endContainer, _range.endOffset );
if ( !range.collapsed ) {
range.moveBoundariesDownTree();
}
}
return range;
};