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:
Ed Sanders 2013-12-11 19:22:42 +00:00
parent a38b1d9420
commit 60262b883e

View file

@ -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;
};
/**