Expand recursive call protection in ve.ui.Window#close

Focussing the view leads to another call of 'close' which
must be protected against.

Bug: 50140
Change-Id: I8c68468a95cddbc7efb222cf3a1f9868b2949285
This commit is contained in:
Ed Sanders 2013-06-26 13:58:35 +01:00
parent ac8d5eccb2
commit 4e728ebf26

View file

@ -326,10 +326,12 @@ ve.ui.Window.prototype.close = function ( action ) {
this.$.hide();
this.visible = false;
this.onClose( action );
this.closing = false;
this.frame.$content.find( ':focus' ).blur();
this.surface.getView().focus();
this.emit( 'close', action );
// Note that focussing the surface view calls an on focus event, which in turn will
// try to close the window again, hence we put this.closing = false right at the bottom
this.closing = false;
}
};