]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Make close() a noop if the dialog is already closed. Fixes #7327 - Dialog...
authorDavid Murdoch <musicisair@yahoo.com>
Thu, 26 May 2011 23:29:11 +0000 (19:29 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 26 May 2011 23:29:11 +0000 (19:29 -0400)
ui/jquery.ui.dialog.js

index dc2849155e04b333264fd44d7d984291161bba0b..8d5f4f56fc433b39f69c4ddc731f33e08ba89fe9 100644 (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 );