// always refresh when changing options
_setOptions: function() {
// _super and _superApply handle keeping the right this-context
- this._superApply( "_setOptions", arguments );
+ this._superApply( arguments );
this._refresh();
},
if ( /red|green|blue/.test(key) && (value < 0 || value > 255) ) {
return;
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
}
});
same( this, instance, "this is correct in testWidget2" );
same( a, 5, "parameter passed to testWidget2" );
same( b, 10, "parameter passed to testWidget2" );
- return this._super( "method", a, b*2 );
+ return this._super( a, b*2 );
}
});
method: function( a ) {
same( this, instance, "this is correct in testWidget3" );
same( a, 5, "parameter passed to testWidget3" );
- var ret = this._super( "method", a, a*2 );
+ var ret = this._super( a, a*2 );
same( ret, 25, "super returned value" );
}
});
same( this, instance, "this is correct in testWidget2" );
same( a, 5, "parameter passed to testWidget2" );
same( b, 10, "second parameter passed to testWidget2" );
- return this._superApply( "method", arguments );
+ return this._superApply( arguments );
}
});
same( this, instance, "this is correct in testWidget3" );
same( a, 5, "parameter passed to testWidget3" );
same( b, 10, "second parameter passed to testWidget3" );
- var ret = this._superApply( "method", arguments );
+ var ret = this._superApply( arguments );
same( ret, 15, "super returned value" );
}
});
$.widget( "ui.testWidget", $.ui.testWidget, {
method: function( str ) {
equal( str, "foo", "new invoked with correct parameter" );
- this._super( "method", "bar" );
+ this._super();
}
});
* jquery.ui.widget.js
*/
(function( $, undefined ) {
-
+
// TODO: use ui-accordion-header-active class and fix styling
$.widget( "ui.accordion", {
version: "@VERSION",
this._setupEvents( value );
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
// setting collapsible: false while collapsed; open first panel
if ( key === "collapsible" && !value && this.options.active === false ) {
if ( position === "absolute" || position === "fixed" ) {
return;
}
- maxHeight -= elem.outerHeight( true );
+ maxHeight -= elem.outerHeight( true );
});
if ( overflow ) {
parent.css( "overflow", overflow );
options.prevHide.stop( true, true );
options.toHide = options.prevShow;
}
-
+
var showOverflow = options.toShow.css( "overflow" ),
hideOverflow = options.toHide.css( "overflow" ),
percentDone = 0,
easing: "swing",
duration: 300
}, options, additions );
-
+
options.widget.lastToggle = options;
if ( !options.toHide.size() ) {
},
_setOption: function( key, value ) {
- this._super( "_setOption", key, value );
+ this._super( key, value );
if ( key === "source" ) {
this._initSource();
}
},
_setOption: function( key, value ) {
- this._super( "_setOption", key, value );
+ this._super( key, value );
if ( key === "disabled" ) {
if ( value ) {
this.element.prop( "disabled", true );
.text(),
icons = this.options.icons,
multipleIcons = icons.primary && icons.secondary,
- buttonClasses = [];
+ buttonClasses = [];
if ( icons.primary || icons.secondary ) {
if ( this.options.text ) {
_create: function() {
this.element.addClass( "ui-buttonset" );
},
-
+
_init: function() {
this.refresh();
},
this.buttons.button( "option", key, value );
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
},
-
+
refresh: function() {
var rtl = this.element.css( "direction" ) === "rtl";
-
+
this.buttons = this.element.find( this.options.items )
.filter( ":ui-button" )
.button( "refresh" )
_destroy: function() {
var self = this;
-
+
if ( self.overlay ) {
self.overlay.destroy();
}
var self = this,
maxZ, thisZ;
-
+
if ( false === self._trigger( "beforeClose", event ) ) {
return;
}
at: myAt.join( " " ),
offset: offset.join( " " )
};
- }
+ }
position = $.extend( {}, $.ui.dialog.prototype.options.position, position );
} else {
$.each( options, function( key, value ) {
self._setOption( key, value );
-
+
if ( key in sizeRelatedOptions ) {
resize = true;
}
if ( isDraggable && !value ) {
uiDialog.draggable( "destroy" );
}
-
+
if ( !isDraggable && value ) {
self._makeDraggable();
}
break;
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
},
_size: function() {
})
.height();
minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
-
+
if ( options.height === "auto" ) {
// only needed for IE6 support
if ( $.support.minHeight ) {
$( document ).bind( "keydown.dialog-overlay", function( event ) {
if ( dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
event.keyCode === $.ui.keyCode.ESCAPE ) {
-
+
dialog.close( event );
event.preventDefault();
}
}
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
},
_value: function() {
return;
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
if ( key === "disabled" ) {
if ( value ) {
},
_setOptions: modifier(function( options ) {
- this._super( "_setOptions", options );
+ this._super( options );
this._value( this.element.val() );
}),
.removeAttr( "aria-valuemin" )
.removeAttr( "aria-valuemax" )
.removeAttr( "aria-valuenow" );
- this._super( "destroy" );
+ this._super();
this.uiSpinner.replaceWith( this.element );
},
return;
}
- this._super( "_setOption", key, value);
+ this._super( key, value);
// setting collapsible: false while collapsed; open first panel
if ( key === "collapsible" && !value && this.options.active === false ) {
if ( tab.hasClass( "ui-state-disabled" ) ||
// tab is already loading
- tab.hasClass( "ui-tabs-loading" ) ||
+ tab.hasClass( "ui-tabs-loading" ) ||
// can't switch durning an animation
that.running ||
// click on active header, but not collapsible
if ( status === "abort" ) {
self.panels.stop( false, true );
}
-
+
self.lis.eq( index ).removeClass( "ui-tabs-loading" );
-
+
if ( jqXHR === self.xhr ) {
delete self.xhr;
}
spinner: "<em>Loading…</em>"
},
_create: function() {
- this._super( "_create" );
+ this._super();
this._bind({
tabsbeforeload: function( event, ui ) {
if ( !this.options.spinner ) {
return;
}
-
+
var span = ui.tab.find( "span" ),
html = span.html();
span.html( this.options.spinner );
}
options.active = active;
}
- this._super( "_create" );
+ this._super();
},
_cookie: function( active ) {
var cookie = [ this.cookie ||
return $.cookie.apply( null, cookie );
},
_refresh: function() {
- this._super( "_refresh" );
+ this._super();
if ( this.options.cookie ) {
this._cookie( this.options.active, this.options.cookie );
}
},
_eventHandler: function( event ) {
- this._superApply( "_eventHandler", arguments );
+ this._superApply( arguments );
if ( this.options.cookie ) {
this._cookie( this.options.active, this.options.cookie );
}
},
_destroy: function() {
- this._super( "_destroy" );
+ this._super();
if ( this.options.cookie ) {
this._cookie( null, this.options.cookie );
}
_data.panel = _data.panel[ 0 ];
_data.tab = _data.tab[ 0 ];
}
- return this._super( "_trigger", type, event, _data );
+ return this._super( type, event, _data );
}
});
}
// disable element style changes
return;
}
- this._super( "_setOption", key, value );
+ this._super( key, value );
},
_disable: function() {
$.each( prototype, function( prop, value ) {
if ( $.isFunction( value ) ) {
prototype[ prop ] = (function() {
- var _super = function( method ) {
- return base.prototype[ method ].apply( this, slice.call( arguments, 1 ) );
+ var _super = function() {
+ return base.prototype[ prop ].apply( this, arguments );
};
- var _superApply = function( method, args ) {
- return base.prototype[ method ].apply( this, args );
+ var _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
};
return function() {
var __super = this._super,