Skip to content
Permalink
Browse files

Dialog: Update the internal flag for whether or not the dialog is ope…

…n before triggering the close event.

Fixes #5184 - isOpen in dialogclose event is true.
  • Loading branch information...
scottgonzalez committed Feb 16, 2010
1 parent 828bcdd commit c9f30818afb8c4cd514fcebc8ee05a409e78e065
Showing with 16 additions and 2 deletions.
  1. +14 −0 tests/unit/dialog/dialog_tickets.js
  2. +2 −2 ui/jquery.ui.dialog.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);
@@ -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;

0 comments on commit c9f3081

Please sign in to comment.
You can’t perform that action at this time.