aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/unit/dialog/dialog_events.js4
-rw-r--r--ui/jquery.ui.dialog.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js
index e2b7bd9ee..8c7657dfd 100644
--- a/tests/unit/dialog/dialog_events.js
+++ b/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');
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 17300b178..a1c911b8e 100644
--- a/ui/jquery.ui.dialog.js
+++ b/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;
},