0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Set a plain text version too on cut/copy

This commit is contained in:
Neil Jenkins 2016-03-12 17:18:21 +11:00
parent 62616ef4ec
commit c895d6b307

View file

@ -15,6 +15,7 @@ var onCut = function ( event ) {
moveRangeBoundariesUpTree( range, body );
node.appendChild( deleteContentsOfRange( range, body ) );
clipboardData.setData( 'text/html', node.innerHTML );
clipboard.setData( 'text/plain', node.innerText || node.textContent );
event.preventDefault();
} else {
setTimeout( function () {
@ -39,6 +40,7 @@ var onCopy = function ( event ) {
if ( !isEdge && clipboardData ) {
node.appendChild( range.cloneContents() );
clipboardData.setData( 'text/html', node.innerHTML );
clipboard.setData( 'text/plain', node.innerText || node.textContent );
event.preventDefault();
}
};