diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 6ad4e34bc2..4118f9e798 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1150,7 +1150,7 @@ function test_dialog() { hide: "explode" }); $("#opener").click(function () { - $("#dialog").dialog("open"); + var $el = $("#dialog").dialog("open"); return false; }); $("#dialog-modal").dialog({ @@ -1163,7 +1163,7 @@ function test_dialog() { modal: true, buttons: { "Delete all items": function () { - $(this).dialog("close"); + var $el = $(this).dialog("close"); }, Cancel: function () { $(this).dialog("close"); @@ -1180,6 +1180,7 @@ function test_dialog() { $(this).dialog("close"); }, close: function () { + var $el = $(this).dialog("destroy"); } }); $("#dialog-message").dialog({ @@ -1211,6 +1212,8 @@ function test_dialog() { $(".selector").dialog({ title: "Dialog Title" }); $(".selector").dialog({ width: 500 }); $(".selector").dialog({ zIndex: 20 }); + var $el = $( ".selector" ).dialog( "moveToTop" ); + var isOpen = $( ".selector" ).dialog( "isOpen" ); } diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 1a09df7fd4..a0e0d64f03 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -849,11 +849,11 @@ interface JQuery { dialog(): JQuery; dialog(methodName: string): JQuery; - dialog(methodName: 'close'): void; - dialog(methodName: 'destroy'): void; + dialog(methodName: 'close'): JQuery; + dialog(methodName: 'destroy'): JQuery; dialog(methodName: 'isOpen'): boolean; - dialog(methodName: 'moveToTop'): void; - dialog(methodName: 'open'): void; + dialog(methodName: 'moveToTop'): JQuery; + dialog(methodName: 'open'): JQuery; dialog(methodName: 'widget'): JQuery; dialog(options: JQueryUI.DialogOptions): JQuery; dialog(optionLiteral: string, optionName: string): any;