mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix error when copying inline text-only.
This commit is contained in:
parent
26b71dee8e
commit
e1d30b7082
3 changed files with 8 additions and 2 deletions
|
@ -2132,6 +2132,9 @@ var onCopy = function ( event ) {
|
|||
moveRangeBoundariesUpTree( range, copyRoot );
|
||||
contents = range.cloneContents();
|
||||
parent = range.commonAncestorContainer;
|
||||
if ( parent.nodeType === TEXT_NODE ) {
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
while ( parent && parent !== copyRoot ) {
|
||||
newContents = parent.cloneNode( false );
|
||||
newContents.appendChild( contents );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -53,6 +53,9 @@ var onCopy = function ( event ) {
|
|||
moveRangeBoundariesUpTree( range, copyRoot );
|
||||
contents = range.cloneContents();
|
||||
parent = range.commonAncestorContainer;
|
||||
if ( parent.nodeType === TEXT_NODE ) {
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
while ( parent && parent !== copyRoot ) {
|
||||
newContents = parent.cloneNode( false );
|
||||
newContents.appendChild( contents );
|
||||
|
|
Loading…
Reference in a new issue