Dialog: Make close() a noop if the dialog is already closed. Fixes #7327 - Dialog box size and close animation bugs.

This commit is contained in:
David Murdoch 2011-05-26 19:29:11 -04:00 committed by Scott González
parent 981e96948f
commit c7eae7b264

View File

@ -190,6 +190,10 @@ $.widget("ui.dialog", {
},
close: function( event ) {
if ( !this._isOpen ) {
return self;
}
var self = this,
maxZ, thisZ;
@ -197,13 +201,13 @@ $.widget("ui.dialog", {
return;
}
self._isOpen = false;
if ( self.overlay ) {
self.overlay.destroy();
}
self.uiDialog.unbind( "keypress.ui-dialog" );
self._isOpen = false;
if ( self.options.hide ) {
self.uiDialog.hide( self.options.hide, function() {
self._trigger( "close", event );