]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: Remove method argument from _super and _superApply. Was a left-over from... 528/head
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 18 Nov 2011 11:19:32 +0000 (12:19 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 18 Nov 2011 16:08:40 +0000 (17:08 +0100)
demos/widget/default.html
tests/unit/widget/widget_core.js
ui/jquery.ui.accordion.js
ui/jquery.ui.autocomplete.js
ui/jquery.ui.button.js
ui/jquery.ui.dialog.js
ui/jquery.ui.progressbar.js
ui/jquery.ui.spinner.js
ui/jquery.ui.tabs.js
ui/jquery.ui.tooltip.js
ui/jquery.ui.widget.js

index 45cbe3298dc08efa55f364da4a8e0cbb8d787c01..3b812ef8e3738b959650e95100bc3c4d63d24137 100644 (file)
                        // 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 );
                        }
                });
 
index 0510da4b4cc84dd2770a67d3f71ae43b95286a6a..edf1ae0fc7ef522dc8048d2b1966e38b6061ab6f 100644 (file)
@@ -346,7 +346,7 @@ test( "._super()", function() {
                        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 );
                }
        });
 
@@ -354,7 +354,7 @@ test( "._super()", function() {
                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" );
                }
        });
@@ -382,7 +382,7 @@ test( "._superApply()", function() {
                        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 );
                }
        });
 
@@ -391,7 +391,7 @@ test( "._superApply()", function() {
                        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" );
                }
        });
@@ -1031,7 +1031,7 @@ test( "redefine", function() {
        $.widget( "ui.testWidget", $.ui.testWidget, {
                method: function( str ) {
                        equal( str, "foo", "new invoked with correct parameter" );
-                       this._super( "method", "bar" );
+                       this._super();
                }
        });
 
index 8289ee81b8ae4bbf273b216e2e87d8b70c9f2ddd..127099d597ab17414efd7b0e42ff1e277c6b8288 100644 (file)
@@ -12,7 +12,7 @@
  *     jquery.ui.widget.js
  */
 (function( $, undefined ) {
-                 
+
 // TODO: use ui-accordion-header-active class and fix styling
 $.widget( "ui.accordion", {
        version: "@VERSION",
@@ -167,7 +167,7 @@ $.widget( "ui.accordion", {
                        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 ) {
@@ -244,7 +244,7 @@ $.widget( "ui.accordion", {
                                if ( position === "absolute" || position === "fixed" ) {
                                        return;
                                }
-                               maxHeight -= elem.outerHeight( true );  
+                               maxHeight -= elem.outerHeight( true );
                        });
                        if ( overflow ) {
                                parent.css( "overflow", overflow );
@@ -437,7 +437,7 @@ $.extend( $.ui.accordion, {
                                options.prevHide.stop( true, true );
                                options.toHide = options.prevShow;
                        }
-                       
+
                        var showOverflow = options.toShow.css( "overflow" ),
                                hideOverflow = options.toHide.css( "overflow" ),
                                percentDone = 0,
@@ -449,7 +449,7 @@ $.extend( $.ui.accordion, {
                                easing: "swing",
                                duration: 300
                        }, options, additions );
-                       
+
                        options.widget.lastToggle = options;
 
                        if ( !options.toHide.size() ) {
index 4e528dce43ff35fe0dcc17f951fc0e0fe5992135..9871b52d773c7716e2feccadd4bee11456513896 100644 (file)
@@ -291,7 +291,7 @@ $.widget( "ui.autocomplete", {
        },
 
        _setOption: function( key, value ) {
-               this._super( "_setOption", key, value );
+               this._super( key, value );
                if ( key === "source" ) {
                        this._initSource();
                }
index 20eb2ca89fe820c8505ab131148d72389509e28d..18a9505633004b41601c336f559b70ab68175318 100644 (file)
@@ -269,7 +269,7 @@ $.widget( "ui.button", {
        },
 
        _setOption: function( key, value ) {
-               this._super( "_setOption", key, value );
+               this._super( key, value );
                if ( key === "disabled" ) {
                        if ( value ) {
                                this.element.prop( "disabled", true );
@@ -326,7 +326,7 @@ $.widget( "ui.button", {
                                .text(),
                        icons = this.options.icons,
                        multipleIcons = icons.primary && icons.secondary,
-                       buttonClasses = [];  
+                       buttonClasses = [];
 
                if ( icons.primary || icons.secondary ) {
                        if ( this.options.text ) {
@@ -365,7 +365,7 @@ $.widget( "ui.buttonset", {
        _create: function() {
                this.element.addClass( "ui-buttonset" );
        },
-       
+
        _init: function() {
                this.refresh();
        },
@@ -375,12 +375,12 @@ $.widget( "ui.buttonset", {
                        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" )
index 9c9a9b6fc74bb52837f23e605de7afff3d751431..49ef8f64b2f222983e5b5e8203f51bda298d643d 100644 (file)
@@ -169,7 +169,7 @@ $.widget("ui.dialog", {
 
        _destroy: function() {
                var self = this;
-               
+
                if ( self.overlay ) {
                        self.overlay.destroy();
                }
@@ -196,7 +196,7 @@ $.widget("ui.dialog", {
 
                var self = this,
                        maxZ, thisZ;
-               
+
                if ( false === self._trigger( "beforeClose", event ) ) {
                        return;
                }
@@ -493,7 +493,7 @@ $.widget("ui.dialog", {
                                        at: myAt.join( " " ),
                                        offset: offset.join( " " )
                                };
-                       } 
+                       }
 
                        position = $.extend( {}, $.ui.dialog.prototype.options.position, position );
                } else {
@@ -518,7 +518,7 @@ $.widget("ui.dialog", {
 
                $.each( options, function( key, value ) {
                        self._setOption( key, value );
-                       
+
                        if ( key in sizeRelatedOptions ) {
                                resize = true;
                        }
@@ -564,7 +564,7 @@ $.widget("ui.dialog", {
                                if ( isDraggable && !value ) {
                                        uiDialog.draggable( "destroy" );
                                }
-                               
+
                                if ( !isDraggable && value ) {
                                        self._makeDraggable();
                                }
@@ -596,7 +596,7 @@ $.widget("ui.dialog", {
                                break;
                }
 
-               this._super( "_setOption", key, value );
+               this._super( key, value );
        },
 
        _size: function() {
@@ -627,7 +627,7 @@ $.widget("ui.dialog", {
                        })
                        .height();
                minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
-               
+
                if ( options.height === "auto" ) {
                        // only needed for IE6 support
                        if ( $.support.minHeight ) {
@@ -704,7 +704,7 @@ $.extend( $.ui.dialog.overlay, {
                        $( 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();
                                }
index 18747068188f8df9860f4823aea57a4ae1cee970..f754f61a4b802f97df8a21440a035fbd0763ea53 100644 (file)
@@ -68,7 +68,7 @@ $.widget( "ui.progressbar", {
                        }
                }
 
-               this._super( "_setOption", key, value );
+               this._super( key, value );
        },
 
        _value: function() {
index 5623722db271b2a6b4354abb022660f3c8da97e9..b78b4dbea1aa8b454da8cbf14e0da4b60ddbf448 100644 (file)
@@ -318,7 +318,7 @@ $.widget( "ui.spinner", {
                        return;
                }
 
-               this._super( "_setOption", key, value );
+               this._super( key, value );
 
                if ( key === "disabled" ) {
                        if ( value ) {
@@ -332,7 +332,7 @@ $.widget( "ui.spinner", {
        },
 
        _setOptions: modifier(function( options ) {
-               this._super( "_setOptions", options );
+               this._super( options );
                this._value( this.element.val() );
        }),
 
@@ -387,7 +387,7 @@ $.widget( "ui.spinner", {
                        .removeAttr( "aria-valuemin" )
                        .removeAttr( "aria-valuemax" )
                        .removeAttr( "aria-valuenow" );
-               this._super( "destroy" );
+               this._super();
                this.uiSpinner.replaceWith( this.element );
        },
 
index 5eaab1aae9e679f4a42de5fd937b2693fd2e3a43..5c9fc1326aedfd198a55e9f40dedbf6c720c59a7 100644 (file)
@@ -136,7 +136,7 @@ $.widget( "ui.tabs", {
                        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 ) {
@@ -323,7 +323,7 @@ $.widget( "ui.tabs", {
 
                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
@@ -555,9 +555,9 @@ $.widget( "ui.tabs", {
                                                if ( status === "abort" ) {
                                                        self.panels.stop( false, true );
                                                }
-       
+
                                                self.lis.eq( index ).removeClass( "ui-tabs-loading" );
-       
+
                                                if ( jqXHR === self.xhr ) {
                                                        delete self.xhr;
                                                }
@@ -674,13 +674,13 @@ if ( $.uiBackCompat !== false ) {
                        spinner: "<em>Loading&#8230;</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 );
@@ -973,7 +973,7 @@ if ( $.uiBackCompat !== false ) {
                                }
                                options.active = active;
                        }
-                       this._super( "_create" );
+                       this._super();
                },
                _cookie: function( active ) {
                        var cookie = [ this.cookie ||
@@ -985,19 +985,19 @@ if ( $.uiBackCompat !== false ) {
                        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 );
                        }
@@ -1012,7 +1012,7 @@ if ( $.uiBackCompat !== false ) {
                                _data.panel = _data.panel[ 0 ];
                                _data.tab = _data.tab[ 0 ];
                        }
-                       return this._super( "_trigger", type, event, _data );
+                       return this._super( type, event, _data );
                }
        });
 }
index 35b6f9b5020e289c9165b2e77a8da0f82d9fd6a6..a006f3bf79a8e258e7b646e59178bfcab5acbc88 100644 (file)
@@ -54,7 +54,7 @@ $.widget( "ui.tooltip", {
                        // disable element style changes
                        return;
                }
-               this._super( "_setOption", key, value );
+               this._super( key, value );
        },
 
        _disable: function() {
index 294e321a91f27c06d1fb35c8d02df5d0d128f03c..53cde389e2a649eaee2593731e1337c0baf2dcf9 100644 (file)
@@ -62,11 +62,11 @@ $.widget = function( name, base, prototype ) {
        $.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,