1beb8a9
click here to add a description
click here to add a homepage
The official jQuery user interface library. — Read more
http://jqueryui.com/
This URL has Read+Write access
Add _superApply method and use it in a few places
@@ -182,4 +182,20 @@ test("_super", function() {
$("<div></div>").child().child("log");
});
+test("_superApply", function() {
+ expect(2);
+ $.widget("sup.parent", {
+ log: function(a, b) {
+ same( a, 1 );
+ same( b, 2 );
+ }
+ });
+ $.widget("sup.child", $.sup.parent, {
+ log: function() {
+ this._superApply("log", arguments);
+ $("<div></div>").child().child("log", 1, 2);
+});
+
})(jQuery);
@@ -151,7 +151,7 @@ $.widget("ui.accordion", {
},
_setOption: function(key, value) {
- $.Widget.prototype._setOption.apply(this, arguments);
+ this._superApply( "_setOption", arguments );
if (key == "active") {
this.activate(value);
@@ -167,7 +167,7 @@ $.widget( "ui.autocomplete", {
_setOption: function( key ) {
- $.Widget.prototype._setOption.apply( this, arguments );
if ( key === "source" ) {
this._initSource();
}
@@ -230,7 +230,7 @@ $.widget( "ui.button", {
_setOption: function( key, value ) {
if ( key === "disabled" ) {
if ( value ) {
this.element.attr( "disabled", true );
@@ -324,7 +324,7 @@ $.widget( "ui.buttonset", {
this.buttons.button( "option", key, value );
refresh: function() {
@@ -43,7 +43,7 @@ $.widget( "ui.progressbar", {
this.valueDiv.remove();
- $.Widget.prototype.destroy.apply( this, arguments );
+ this._superApply( "destroy", arguments );
value: function( newValue ) {
@@ -64,7 +64,7 @@ $.widget( "ui.progressbar", {
break;
_value: function() {
@@ -511,7 +511,7 @@ $.widget( "ui.slider", $.ui.mouse, {
valsLength = this.options.values.length;
switch ( key ) {
case "disabled":
@@ -81,7 +81,7 @@ $.widget("ui.sortable", $.ui.mouse, {
[ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
} else {
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
@@ -151,6 +151,10 @@ $.Widget.prototype = {
this.base[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
+ _superApply: function( method, args ) {
+ this.base[ method ].apply( this, args );
+ },
destroy: function() {
this.element
.unbind( "." + this.widgetName )
1beb8a91beb8a91beb8a91beb8a91beb8a91beb8a91beb8a91beb8a9