0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Merge pull request #77 from mkoryak-master

This commit is contained in:
Neil Jenkins 2015-05-03 13:18:45 +07:00
commit 96bdda13ca
4 changed files with 28 additions and 20 deletions

View file

@ -1,4 +1,4 @@
/* Copyright © 2011-2013 by Neil Jenkins. MIT Licensed. */
/* Copyright © 2011-2015 by Neil Jenkins. MIT Licensed. */
( function ( doc, undefined ) {
@ -3082,21 +3082,25 @@ proto._onPaste = function ( event ) {
removeEmptyInlines( frag );
var node = frag,
doPaste = true;
doPaste = true,
event = {
fragment: frag,
preventDefault: function () {
doPaste = false;
},
isDefaultPrevented: function () {
return !doPaste;
}
};
while ( node = getNextBlock( node ) ) {
fixCursor( node );
}
self.fireEvent( 'willPaste', {
fragment: frag,
preventDefault: function () {
doPaste = false;
}
});
self.fireEvent( 'willPaste', event );
// Insert pasted data
if ( doPaste ) {
insertTreeFragmentIntoRange( range, frag );
insertTreeFragmentIntoRange( range, event.fragment );
if ( !canObserveMutations ) {
self._docWasChanged();
}

File diff suppressed because one or more lines are too long

View file

@ -1658,21 +1658,25 @@ proto._onPaste = function ( event ) {
removeEmptyInlines( frag );
var node = frag,
doPaste = true;
doPaste = true,
event = {
fragment: frag,
preventDefault: function () {
doPaste = false;
},
isDefaultPrevented: function () {
return !doPaste;
}
};
while ( node = getNextBlock( node ) ) {
fixCursor( node );
}
self.fireEvent( 'willPaste', {
fragment: frag,
preventDefault: function () {
doPaste = false;
}
});
self.fireEvent( 'willPaste', event );
// Insert pasted data
if ( doPaste ) {
insertTreeFragmentIntoRange( range, frag );
insertTreeFragmentIntoRange( range, event.fragment );
if ( !canObserveMutations ) {
self._docWasChanged();
}

View file

@ -1,4 +1,4 @@
/* Copyright © 2011-2013 by Neil Jenkins. MIT Licensed. */
/* Copyright © 2011-2015 by Neil Jenkins. MIT Licensed. */
/*jshint ignore:start */
( function ( doc, undefined ) {