Skip to content

Commit c7eae7b

Browse files
David Murdochscottgonzalez
authored andcommitted
Dialog: Make close() a noop if the dialog is already closed. Fixes #7327 - Dialog box size and close animation bugs.
1 parent 981e969 commit c7eae7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/jquery.ui.dialog.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,20 +190,24 @@ $.widget("ui.dialog", {
190190
},
191191

192192
close: function( event ) {
193+
if ( !this._isOpen ) {
194+
return self;
195+
}
196+
193197
var self = this,
194198
maxZ, thisZ;
195199

196200
if ( false === self._trigger( "beforeClose", event ) ) {
197201
return;
198202
}
199203

204+
self._isOpen = false;
205+
200206
if ( self.overlay ) {
201207
self.overlay.destroy();
202208
}
203209
self.uiDialog.unbind( "keypress.ui-dialog" );
204210

205-
self._isOpen = false;
206-
207211
if ( self.options.hide ) {
208212
self.uiDialog.hide( self.options.hide, function() {
209213
self._trigger( "close", event );

0 commit comments

Comments
 (0)