Simplify teardown of toolbar save button

Bug: T136421
Change-Id: I6829ad75b93c6aa6c6db51b5c9cd84915c75cdb8
This commit is contained in:
Ed Sanders 2016-06-01 17:52:58 +01:00
parent 02b3d6bad9
commit 0a0ca68d62

View file

@ -609,12 +609,7 @@ ve.init.mw.DesktopArticleTarget.prototype.cancel = function ( trackMechanism ) {
this.originalEditondbclick = undefined;
if ( this.toolbarSaveButton ) {
// If deactivate is called before a successful load, then the save button has not yet been
// fully set up so disconnecting it would throw an error when trying call methods on the
// button property (bug 46456)
this.toolbarSaveButton.disconnect( this );
this.toolbarSaveButton.$element.detach();
this.getToolbar().$actions.empty();
this.toolbarSaveButton = null;
}
// Check we got as far as setting up the surface