mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Revert "Use pushStack in widget method. Fixes #5732 - make the widget method maintain the stack"
This reverts commit ea58cd5ac0
.
This commit is contained in:
parent
dffcba0ba6
commit
58ae7ce2fd
@ -38,14 +38,6 @@ test("search", function() {
|
|||||||
same( $(".ui-menu .ui-menu-item").length, 2, "only java and javascript for 'ja'" );
|
same( $(".ui-menu .ui-menu-item").length, 2, "only java and javascript for 'ja'" );
|
||||||
|
|
||||||
$("#autocomplete").autocomplete("destroy");
|
$("#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);
|
})(jQuery);
|
||||||
|
@ -16,18 +16,4 @@ test("destroy", function() {
|
|||||||
equal( afterHtml, beforeHtml );
|
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);
|
})(jQuery);
|
||||||
|
@ -130,10 +130,4 @@ test("open", function() {
|
|||||||
ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog visible after open method called');
|
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);
|
})(jQuery);
|
||||||
|
@ -151,8 +151,7 @@ test(".widget() - base", function() {
|
|||||||
_create: function() {}
|
_create: function() {}
|
||||||
});
|
});
|
||||||
var div = $("<div></div>").testWidget()
|
var div = $("<div></div>").testWidget()
|
||||||
same(div.testWidget("widget")[0], div[0]);
|
same(div[0], div.testWidget("widget")[0]);
|
||||||
same(div.testWidget("widget").end()[0], div[0]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test(".widget() - overriden", function() {
|
test(".widget() - overriden", function() {
|
||||||
@ -160,12 +159,10 @@ test(".widget() - overriden", function() {
|
|||||||
$.widget("ui.testWidget", {
|
$.widget("ui.testWidget", {
|
||||||
_create: function() {},
|
_create: function() {},
|
||||||
widget: function() {
|
widget: function() {
|
||||||
return this.element.pushStack(wrapper.get());
|
return wrapper;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var div = $("<div></div>").testWidget();
|
same(wrapper[0], $("<div></div>").testWidget().testWidget("widget")[0]);
|
||||||
same(div.testWidget("widget")[0], wrapper[0]);
|
|
||||||
same(div.testWidget("widget").end()[0], div[0]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
2
ui/jquery.ui.autocomplete.js
vendored
2
ui/jquery.ui.autocomplete.js
vendored
@ -311,7 +311,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
widget: function() {
|
widget: function() {
|
||||||
return this.element.pushStack(this.menu.element.get());
|
return this.menu.element;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
ui/jquery.ui.button.js
vendored
2
ui/jquery.ui.button.js
vendored
@ -210,7 +210,7 @@ $.widget( "ui.button", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
widget: function() {
|
widget: function() {
|
||||||
return this.element.pushStack(this.buttonElement.get());
|
return this.buttonElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
2
ui/jquery.ui.dialog.js
vendored
2
ui/jquery.ui.dialog.js
vendored
@ -207,7 +207,7 @@ $.widget("ui.dialog", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
widget: function() {
|
widget: function() {
|
||||||
return this.element.pushStack(this.uiDialog.get());
|
return this.uiDialog;
|
||||||
},
|
},
|
||||||
|
|
||||||
close: function(event) {
|
close: function(event) {
|
||||||
|
2
ui/jquery.ui.widget.js
vendored
2
ui/jquery.ui.widget.js
vendored
@ -160,7 +160,7 @@ $.Widget.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
widget: function() {
|
widget: function() {
|
||||||
return this.element.pushStack(this.element.get());
|
return this.element;
|
||||||
},
|
},
|
||||||
|
|
||||||
option: function( key, value ) {
|
option: function( key, value ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user