0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-08 16:00:06 -05:00

BUG FIX: Restore copy/cut function on iOS

This commit is contained in:
Nat Osten 2016-03-30 15:08:29 -07:00
parent e133f26db1
commit 7259145552

View file

@ -1989,7 +1989,7 @@ var onCut = function ( event ) {
this.saveUndoState( range ); this.saveUndoState( range );
// Edge only seems to support setting plain text as of 2016-03-11. // Edge only seems to support setting plain text as of 2016-03-11.
if ( !isEdge && clipboardData ) { if ( !isEdge && !isIOS && clipboardData ) {
moveRangeBoundariesUpTree( range, body ); moveRangeBoundariesUpTree( range, body );
node.appendChild( deleteContentsOfRange( range, body ) ); node.appendChild( deleteContentsOfRange( range, body ) );
clipboardData.setData( 'text/html', node.innerHTML ); clipboardData.setData( 'text/html', node.innerHTML );
@ -2016,7 +2016,7 @@ var onCopy = function ( event ) {
var node = this.createElement( 'div' ); var node = this.createElement( 'div' );
// Edge only seems to support setting plain text as of 2016-03-11. // Edge only seems to support setting plain text as of 2016-03-11.
if ( !isEdge && clipboardData ) { if ( !isEdge && !isIOS && clipboardData ) {
node.appendChild( range.cloneContents() ); node.appendChild( range.cloneContents() );
clipboardData.setData( 'text/html', node.innerHTML ); clipboardData.setData( 'text/html', node.innerHTML );
clipboardData.setData( 'text/plain', clipboardData.setData( 'text/plain',