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

Update to latest squire build

This commit is contained in:
Neil Jenkins 2016-05-26 13:55:01 +10:00
parent db6aaee0dc
commit 4ec6f03d68
2 changed files with 8 additions and 14 deletions

View file

@ -2228,10 +2228,11 @@ var onPaste = function ( event ) {
}, 0 ); }, 0 );
}; };
// On Windows you can drag an drop text. // On Windows you can drag an drop text. We can't handle this ourselves, because
// as far as I can see, there's no way to get the drop insertion point. So just
// save an undo state and hope for the best.
var onDrop = function ( event ) { var onDrop = function ( event ) {
var dataTransfer = event.dataTransfer; var types = event.dataTransfer.types;
var types = dataTransfer.types;
var l = types.length; var l = types.length;
var hasPlain = false; var hasPlain = false;
var hasHTML = false; var hasHTML = false;
@ -2247,15 +2248,8 @@ var onDrop = function ( event ) {
return; return;
} }
} }
if ( hasHTML ) { if ( hasHTML || hasPlain ) {
event.preventDefault(); this.saveUndoState();
this.insertHTML( dataTransfer.getData( 'text/html' ), true );
return;
}
if ( hasPlain ) {
event.preventDefault();
this.insertPlainText( dataTransfer.getData( 'text/plain' ), true );
return;
} }
}; };

File diff suppressed because one or more lines are too long