diff options
-rw-r--r-- | tests/unit/dialog/dialog_tickets.js | 14 | ||||
-rw-r--r-- | ui/jquery.ui.dialog.js | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js index d2fe271e6..296102c9b 100644 --- a/tests/unit/dialog/dialog_tickets.js +++ b/tests/unit/dialog/dialog_tickets.js @@ -26,4 +26,18 @@ test("#4826: setting resizable false toggles resizable on dialog", function() { }); +test("#5184: isOpen in dialogclose event is true", function() { + expect( 3 ); + + el = $( "<div></div>" ).dialog({ + close: function() { + ok( !el.dialog("isOpen"), "dialog is not open during close" ); + } + }); + ok( el.dialog("isOpen"), "dialog is open after init" ); + el.dialog( "close" ); + ok( !el.dialog("isOpen"), "dialog is not open after close" ); + el.remove(); +}); + })(jQuery); diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index aba6f50b7..53af64142 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -188,6 +188,8 @@ $.widget("ui.dialog", { (self.overlay && self.overlay.destroy()); self.uiDialog.unbind('keypress.ui-dialog'); + self._isOpen = false; + (self.options.hide ? self.uiDialog.hide(self.options.hide, function() { self._trigger('close', event); @@ -196,8 +198,6 @@ $.widget("ui.dialog", { $.ui.dialog.overlay.resize(); - self._isOpen = false; - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) if (self.options.modal) { var maxZ = 0; |