mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Dialog: Removed handling of deprecated beforeclose option. Fixes #5100 - Dialog: remove deprecated dialog option beforeclose.
This commit is contained in:
parent
9ad2a4b1cc
commit
b42125af43
@ -212,38 +212,6 @@ test("close", function() {
|
||||
el.remove();
|
||||
});
|
||||
|
||||
//handling of deprecated beforeclose (vs beforeClose) option
|
||||
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
|
||||
//TODO: remove in 1.9pre
|
||||
test("beforeclose", function() {
|
||||
expect(10);
|
||||
|
||||
el = $('<div></div>').dialog({
|
||||
beforeclose: function(ev, ui) {
|
||||
ok(true, '.dialog("close") fires beforeClose callback');
|
||||
equals(this, el[0], "context of callback");
|
||||
equals(ev.type, 'dialogbeforeclose', 'event type in callback');
|
||||
same(ui, {}, 'ui hash in callback');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
el.dialog('close');
|
||||
isOpen('beforeclose (deprecated) callback should prevent dialog from closing');
|
||||
el.remove();
|
||||
|
||||
el = $('<div></div>').dialog();
|
||||
el.dialog('option', 'beforeclose', function(ev, ui) {
|
||||
ok(true, '.dialog("close") fires beforeClose callback');
|
||||
equals(this, el[0], "context of callback");
|
||||
equals(ev.type, 'dialogbeforeclose', 'event type in callback');
|
||||
same(ui, {}, 'ui hash in callback');
|
||||
return false;
|
||||
});
|
||||
el.dialog('close');
|
||||
isOpen('beforeclose (deprecated) callback should prevent dialog from closing');
|
||||
el.remove();
|
||||
});
|
||||
|
||||
test("beforeClose", function() {
|
||||
expect(14);
|
||||
|
||||
|
13
ui/jquery.ui.dialog.js
vendored
13
ui/jquery.ui.dialog.js
vendored
@ -171,13 +171,6 @@ $.widget("ui.dialog", {
|
||||
.html(title)
|
||||
.prependTo(uiDialogTitlebar);
|
||||
|
||||
//handling of deprecated beforeclose (vs beforeClose) option
|
||||
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
|
||||
//TODO: remove in 1.9pre
|
||||
if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
|
||||
options.beforeClose = options.beforeclose;
|
||||
}
|
||||
|
||||
uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
|
||||
|
||||
if (options.draggable && $.fn.draggable) {
|
||||
@ -563,12 +556,6 @@ $.widget("ui.dialog", {
|
||||
uiDialog = self.uiDialog;
|
||||
|
||||
switch (key) {
|
||||
//handling of deprecated beforeclose (vs beforeClose) option
|
||||
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
|
||||
//TODO: remove in 1.9pre
|
||||
case "beforeclose":
|
||||
key = "beforeClose";
|
||||
break;
|
||||
case "buttons":
|
||||
self._createButtons(value);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user