From: Scott González Date: Fri, 30 Jul 2010 16:38:18 +0000 (-0400) Subject: Revert "Use pushStack in widget method. Fixes #5732 - make the widget method maintain... X-Git-Tag: 1.8.3~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=58ae7ce2fd20fb865c9087fb2eae0dbdb39fc9a7;p=jquery-ui.git Revert "Use pushStack in widget method. Fixes #5732 - make the widget method maintain the stack" This reverts commit ea58cd5ac0d852a9c7d7ceadbcbb74006cf9052d. --- diff --git a/tests/unit/autocomplete/autocomplete_methods.js b/tests/unit/autocomplete/autocomplete_methods.js index a009a83f5..05a7d6e14 100644 --- a/tests/unit/autocomplete/autocomplete_methods.js +++ b/tests/unit/autocomplete/autocomplete_methods.js @@ -38,14 +38,6 @@ test("search", function() { same( $(".ui-menu .ui-menu-item").length, 2, "only java and javascript for 'ja'" ); $("#autocomplete").autocomplete("destroy"); -}); - -test("widget", function() { - var ac = $("#autocomplete").autocomplete({ - source: data - }); - same(ac.autocomplete("widget")[0], $(":ui-menu")[0]); - same(ac.autocomplete("widget").end()[0], ac[0]); -}); +}) })(jQuery); diff --git a/tests/unit/button/button_methods.js b/tests/unit/button/button_methods.js index 5197bc40c..a83a73ba4 100644 --- a/tests/unit/button/button_methods.js +++ b/tests/unit/button/button_methods.js @@ -16,18 +16,4 @@ test("destroy", function() { equal( afterHtml, beforeHtml ); }); -test("widget", function() { - var submit = $("#submit").button(); - same(submit.button("widget")[0], submit[0]); - same(submit.button("widget").end()[0], submit[0]); - - var check = $("#check").button(); - same(check.button("widget")[0], check.next("label")[0]); - same(check.button("widget").end()[0], check[0]); - - var radio = $("#radio01").button(); - same(radio.button("widget")[0], radio.next("label")[0]); - same(radio.button("widget").end()[0], radio[0]); -}); - })(jQuery); diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index e4b77aa0b..93d1b25db 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -130,10 +130,4 @@ test("open", function() { ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog visible after open method called'); }); -test("widget", function() { - var dialog = $('
').dialog(); - same(dialog.dialog("widget")[0], dialog.parent()[0]); - same(dialog.dialog("widget").end()[0], dialog[0]); -}); - })(jQuery); diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 52c91d51e..3c870f1fe 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -151,8 +151,7 @@ test(".widget() - base", function() { _create: function() {} }); var div = $("
").testWidget() - same(div.testWidget("widget")[0], div[0]); - same(div.testWidget("widget").end()[0], div[0]); + same(div[0], div.testWidget("widget")[0]); }); test(".widget() - overriden", function() { @@ -160,12 +159,10 @@ test(".widget() - overriden", function() { $.widget("ui.testWidget", { _create: function() {}, widget: function() { - return this.element.pushStack(wrapper.get()); + return wrapper; } }); - var div = $("
").testWidget(); - same(div.testWidget("widget")[0], wrapper[0]); - same(div.testWidget("widget").end()[0], div[0]); + same(wrapper[0], $("
").testWidget().testWidget("widget")[0]); }); })(jQuery); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index e93818d53..855037824 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -311,7 +311,7 @@ $.widget( "ui.autocomplete", { }, widget: function() { - return this.element.pushStack(this.menu.element.get()); + return this.menu.element; } }); diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 54e099a0a..b2fab4d24 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -210,7 +210,7 @@ $.widget( "ui.button", { }, widget: function() { - return this.element.pushStack(this.buttonElement.get()); + return this.buttonElement; }, destroy: function() { diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 0122ce905..df11e2190 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -207,7 +207,7 @@ $.widget("ui.dialog", { }, widget: function() { - return this.element.pushStack(this.uiDialog.get()); + return this.uiDialog; }, close: function(event) { diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index b5e10ba0f..e21287ae0 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -160,7 +160,7 @@ $.Widget.prototype = { }, widget: function() { - return this.element.pushStack(this.element.get()); + return this.element; }, option: function( key, value ) {