]> source.dussan.org Git - jquery-ui.git/commitdiff
Revert "Use pushStack in widget method. Fixes #5732 - make the widget method maintain...
authorScott González <scott.gonzalez@gmail.com>
Fri, 30 Jul 2010 16:38:18 +0000 (12:38 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 30 Jul 2010 16:38:18 +0000 (12:38 -0400)
This reverts commit ea58cd5ac0d852a9c7d7ceadbcbb74006cf9052d.

tests/unit/autocomplete/autocomplete_methods.js
tests/unit/button/button_methods.js
tests/unit/dialog/dialog_methods.js
tests/unit/widget/widget_core.js
ui/jquery.ui.autocomplete.js
ui/jquery.ui.button.js
ui/jquery.ui.dialog.js
ui/jquery.ui.widget.js

index a009a83f5796854075d2cda72ce3b8e99ed65bd5..05a7d6e1448737727830129486d9d60ef5604af5 100644 (file)
@@ -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);
index 5197bc40c4ab93baa1c339916ce2bf0c655d52ae..a83a73ba406b985162c03ac8a69994a5eedeeb96 100644 (file)
@@ -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);
index e4b77aa0bfe3b17baead397557a6a7679f892044..93d1b25db7b5cb94125862d7e398253b8fc3b34a 100644 (file)
@@ -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 = $('<div></div>').dialog();
-       same(dialog.dialog("widget")[0], dialog.parent()[0]);
-       same(dialog.dialog("widget").end()[0], dialog[0]);
-});
-
 })(jQuery);
index 52c91d51ee7075bf2d66aac63a122771304e9d24..3c870f1fe18f217842d35b21e017d247c15e7a03 100644 (file)
@@ -151,8 +151,7 @@ test(".widget() - base", function() {
                _create: function() {}
        });
        var div = $("<div></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 = $("<div></div>").testWidget();
-       same(div.testWidget("widget")[0], wrapper[0]);
-       same(div.testWidget("widget").end()[0], div[0]);
+       same(wrapper[0], $("<div></div>").testWidget().testWidget("widget")[0]);
 });
 
 })(jQuery);
index e93818d5304ce81a4a78a664e8b2f6f868df4800..8550378241adc2bef42cd5bbdb976178245aa2bb 100644 (file)
@@ -311,7 +311,7 @@ $.widget( "ui.autocomplete", {
        },
 
        widget: function() {
-               return this.element.pushStack(this.menu.element.get());
+               return this.menu.element;
        }
 });
 
index 54e099a0a3071114424fdbc7fd72d1a16603457a..b2fab4d2452dabd4c0f09c8aa5db55de8886ed4d 100644 (file)
@@ -210,7 +210,7 @@ $.widget( "ui.button", {
        },
 
        widget: function() {
-               return this.element.pushStack(this.buttonElement.get());
+               return this.buttonElement;
        },
 
        destroy: function() {
index 0122ce90538c0ec30fe7af779ce915828633d51a..df11e2190a16f2bf28373f0cc1993d97b628bf99 100644 (file)
@@ -207,7 +207,7 @@ $.widget("ui.dialog", {
        },
 
        widget: function() {
-               return this.element.pushStack(this.uiDialog.get());
+               return this.uiDialog;
        },
 
        close: function(event) {
index b5e10ba0fbfe67884e68a4a365a35f784fd218a3..e21287ae0562ea24ad3ab3aceacf30e82feca32e 100644 (file)
@@ -160,7 +160,7 @@ $.Widget.prototype = {
        },
 
        widget: function() {
-               return this.element.pushStack(this.element.get());
+               return this.element;
        },
 
        option: function( key, value ) {