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:
parent
62616ef4ec
commit
c895d6b307
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue