mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Merge pull request #77 from mkoryak-master
This commit is contained in:
commit
96bdda13ca
4 changed files with 28 additions and 20 deletions
|
@ -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
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue