mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
Move resetting of paste state variables to after afterPaste
So that if the function bails with a return they are still run. Bug: 58346 Change-Id: Ibd0f194e9c31e2b023dbd00a13ade51785f78ae6
This commit is contained in:
parent
a38b1d9420
commit
60262b883e
|
@ -769,7 +769,14 @@ ve.ce.Surface.prototype.onPaste = function ( e ) {
|
|||
}
|
||||
this.pasting = true;
|
||||
this.beforePaste( e );
|
||||
setTimeout( ve.bind( this.afterPaste, this, e ) );
|
||||
setTimeout( ve.bind( function () {
|
||||
this.afterPaste( e );
|
||||
|
||||
// Allow pasting again
|
||||
this.pasting = false;
|
||||
this.pasteSpecial = false;
|
||||
this.beforePasteData = null;
|
||||
}, this ) );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1068,11 +1075,6 @@ ve.ce.Surface.prototype.afterPaste = function () {
|
|||
this.model.change( tx, new ve.Range( selection.start ) );
|
||||
// Move cursor to end of selection
|
||||
this.model.setSelection( new ve.Range( selection.end ) );
|
||||
|
||||
// Allow pasting again
|
||||
this.pasting = false;
|
||||
this.pasteSpecial = false;
|
||||
this.beforePasteData = null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue