el.remove();
});
-test("close", function() {
- expect(7);
+asyncTest("close", function() {
+ expect(14);
el = $('<div></div>').dialog({
close: function(ev, ui) {
});
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() {
}
if ( this.options.hide ) {
- this.uiDialog.hide( this.options.hide, function() {
+ this._hide( this.uiDialog, this.options.hide, function() {
that._trigger( "close", event );
});
} else {