diff options
author | David Petersen <public@petersendidit.com> | 2012-10-17 09:28:51 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-10-17 20:28:27 -0400 |
commit | 35dc9307fc2ce5d2016e8848fdc578829867f97e (patch) | |
tree | f790ab2b80820832de325a70899b96383c367fe4 /tests/unit/dialog | |
parent | dda1925d0f8d19b4baffa20259674dcef85e8bab (diff) | |
download | jquery-ui-35dc9307fc2ce5d2016e8848fdc578829867f97e.tar.gz jquery-ui-35dc9307fc2ce5d2016e8848fdc578829867f97e.zip |
Dialog: Use _hide() to make sure close event gets triggered. Fixes #8684 - jQuery dialog with hide options does not trigger close event.
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r-- | tests/unit/dialog/dialog_events.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index 85afa5a3b..515bebdc1 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -195,8 +195,8 @@ test("resizeStop", function() { el.remove(); }); -test("close", function() { - expect(7); +asyncTest("close", function() { + expect(14); el = $('<div></div>').dialog({ close: function(ev, ui) { @@ -212,6 +212,23 @@ test("close", function() { }); el.dialog('close'); el.remove(); + + // Close event with an effect + el = $('<div></div>').dialog({ + hide: 10, + close: function(ev, ui) { + ok(true, '.dialog("close") fires close callback'); + equal(this, el[0], "context of callback"); + equal(ev.type, 'dialogclose', 'event type in callback'); + deepEqual(ui, {}, 'ui hash in callback'); + start(); + } + }).bind('dialogclose', function(ev, ui) { + ok(true, '.dialog("close") fires dialogclose event'); + equal(this, el[0], 'context of event'); + deepEqual(ui, {}, 'ui hash in event'); + }); + el.dialog('close'); }); test("beforeClose", function() { |