diff --git a/tests/visual/dialog/dialog_ticket-7327.html b/tests/visual/dialog/dialog_ticket-7327.html new file mode 100644 index 00000000000..85cf8279adb --- /dev/null +++ b/tests/visual/dialog/dialog_ticket-7327.html @@ -0,0 +1,49 @@ + + + + + Dialog Visual Test : Modal Dialog should Only Close Once + + + + + + + + + + + + +
+ Hello. When you press the close button make sure the dialog's close animation only plays once.
+ #7327: Dialog box size and close animation bugs

+ Close +
+Click Me To Open + + + diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index dc2849155e0..32e63c11a11 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -196,14 +196,17 @@ $.widget("ui.dialog", { if ( false === self._trigger( "beforeClose", event ) ) { return; } - + + if( !self._isOpen ) { + return self; + } + 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 );