Skip to content

Commit

Permalink
Dialog: Set the _isOpen flag before triggering the open event. Fixes …
Browse files Browse the repository at this point in the history
…#6012 - Dialog: _isOpen flag should be set before triggering open event.
  • Loading branch information
scottgonzalez committed Sep 2, 2010
1 parent 5de8ced commit de02aa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/unit/dialog/dialog_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion ui/jquery.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit de02aa3

Please sign in to comment.