0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Improve copying of plain text on windows

This commit is contained in:
Neil Jenkins 2016-12-11 12:33:06 +11:00
parent 2ddbd53a5a
commit 8d51967645
2 changed files with 4 additions and 4 deletions

View file

@ -2129,7 +2129,7 @@ var cleanupBRs = function ( node, root ) {
// The (non-standard but supported enough) innerText property is based on the // The (non-standard but supported enough) innerText property is based on the
// render tree in Firefox and possibly other browsers, so we must insert the // render tree in Firefox and possibly other browsers, so we must insert the
// DOM node into the document to ensure the text part is correct. // DOM node into the document to ensure the text part is correct.
var setClipboardData = function ( clipboardData, node ) { var setClipboardData = function ( clipboardData, node, root ) {
var body = node.ownerDocument.body; var body = node.ownerDocument.body;
var html, text; var html, text;
@ -2173,7 +2173,7 @@ var onCut = function ( event ) {
if ( !isEdge && !isIOS && clipboardData ) { if ( !isEdge && !isIOS && clipboardData ) {
moveRangeBoundariesUpTree( range, root ); moveRangeBoundariesUpTree( range, root );
node.appendChild( deleteContentsOfRange( range, root ) ); node.appendChild( deleteContentsOfRange( range, root ) );
setClipboardData( clipboardData, node ); setClipboardData( clipboardData, node, root );
event.preventDefault(); event.preventDefault();
} else { } else {
setTimeout( function () { setTimeout( function () {
@ -2219,7 +2219,7 @@ var onCopy = function ( event ) {
} }
node.appendChild( contents ); node.appendChild( contents );
setClipboardData( clipboardData, node ); setClipboardData( clipboardData, node, root );
event.preventDefault(); event.preventDefault();
} }
}; };

File diff suppressed because one or more lines are too long