Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Dialog: Set the _isOpen flag before triggering the open event. Fixes …

…#6012 - Dialog: _isOpen flag should be set before triggering open event.
  • Loading branch information...
commit de02aa34a80eec32ad19e0c83ac88073ee551483 1 parent 5de8ced
@scottgonzalez scottgonzalez authored
Showing with 4 additions and 2 deletions.
  1. +3 −1 tests/unit/dialog/dialog_events.js
  2. +1 −1  ui/jquery.ui.dialog.js
View
4 tests/unit/dialog/dialog_events.js
@@ -6,11 +6,12 @@
module("dialog: events");
test("open", function() {
- expect(11);
+ expect(13);
el = $("<div></div>");
el.dialog({
open: function(ev, ui) {
+ ok(el.data("dialog")._isOpen, "interal _isOpen flag is set");
ok(true, 'autoOpen: true fires open callback');
equals(this, el[0], "context of callback");
equals(ev.type, 'dialogopen', 'event type in callback');
@@ -29,6 +30,7 @@ test("open", function() {
same(ui, {}, 'ui hash in callback');
}
}).bind('dialogopen', function(ev, ui) {
+ ok(el.data("dialog")._isOpen, "interal _isOpen flag is set");
ok(true, 'dialog("open") fires open event');
equals(this, el[0], 'context of event');
same(ui, {}, 'ui hash in event');
View
2  ui/jquery.ui.dialog.js
@@ -329,8 +329,8 @@ $.widget("ui.dialog", {
uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
uiDialog.get()))).eq(0).focus();
- self._trigger('open');
self._isOpen = true;
+ self._trigger('open');
return self;
},
Please sign in to comment.
Something went wrong with that request. Please try again.