From c7eae7b264112919462cb1b8b7ce115d3b24265d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 26 May 2011 19:29:11 -0400 Subject: [PATCH] Dialog: Make close() a noop if the dialog is already closed. Fixes #7327 - Dialog box size and close animation bugs. --- ui/jquery.ui.dialog.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index dc2849155..8d5f4f56f 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -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 ); -- 2.39.5