]> source.dussan.org Git - jquery-ui.git/commitdiff
A few lint fixes.
authorScott González <scott.gonzalez@gmail.com>
Mon, 2 Apr 2012 19:55:50 +0000 (15:55 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 2 Apr 2012 19:55:50 +0000 (15:55 -0400)
12 files changed:
ui/jquery.effects.core.js
ui/jquery.effects.drop.js
ui/jquery.effects.scale.js
ui/jquery.effects.shake.js
ui/jquery.effects.slide.js
ui/jquery.ui.accordion.js
ui/jquery.ui.autocomplete.js
ui/jquery.ui.core.js
ui/jquery.ui.menu.js
ui/jquery.ui.mouse.js
ui/jquery.ui.position.js
ui/jquery.ui.tabs.js

index 1f074e6e21c9e66e378dc63a85be4205c55f3ab4..62d6b2c380c6f78a3d54580ffc18076d83b6741e 100644 (file)
@@ -171,9 +171,9 @@ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopS
 });
 
 function getElementStyles() {
-       var style = this.ownerDocument.defaultView
-                       ? this.ownerDocument.defaultView.getComputedStyle( this, null )
-                       this.currentStyle,
+       var style = this.ownerDocument.defaultView ?
+                       this.ownerDocument.defaultView.getComputedStyle( this, null ) :
+                       this.currentStyle,
                newStyle = {},
                key,
                camelCase,
@@ -375,13 +375,13 @@ $.extend( $.effects, {
                        case "middle": y = 0.5; break;
                        case "bottom": y = 1; break;
                        default: y = origin[ 0 ] / original.height;
-               };
+               }
                switch ( origin[ 1 ] ) {
                        case "left": x = 0; break;
                        case "center": x = 0.5; break;
                        case "right": x = 1; break;
                        default: x = origin[ 1 ] / original.width;
-               };
+               }
                return {
                        x: x,
                        y: y
@@ -523,8 +523,10 @@ function _normalizeArguments( effect, options, speed, callback ) {
        }
 
        speed = speed || options.duration;
-       effect.duration = $.fx.off ? 0 : typeof speed === "number"
-               ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
+       effect.duration = $.fx.off ? 0 :
+               typeof speed === "number" ? speed :
+               speed in $.fx.speeds ? $.fx.speeds[ speed ] :
+               $.fx.speeds._default;
 
        effect.complete = callback || options.complete;
 
@@ -701,7 +703,7 @@ $.each( baseEasings, function( name, easeIn ) {
                return 1 - easeIn( 1 - p );
        };
        $.easing[ "easeInOut" + name ] = function( p ) {
-               return p < .5 ?
+               return p < 0.5 ?
                        easeIn( p * 2 ) / 2 :
                        easeIn( p * -2 + 2 ) / -2 + 1;
        };
index 8ccbfe57dfb86776b6a951aa0552e51c15f78cbf..6c72be9e58f0820e6c6cdd3f9fe03b78ed5414be 100644 (file)
@@ -31,19 +31,19 @@ $.effects.effect.drop = function( o, done ) {
        el.show(); 
        $.effects.createWrapper( el ); 
 
-       distance = o.distance || el[ ref == "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2;
+       distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2;
 
        if ( show ) {
                el
                        .css( "opacity", 0 )
-                       .css( ref, motion == "pos" ? -distance : distance );
+                       .css( ref, motion === "pos" ? -distance : distance );
        }
 
        // Animation
        animation[ ref ] = ( show ? 
                ( motion === "pos" ? "+=" : "-=" ) : 
-               ( motion === "pos" ? "-=" : "+=" ) ) 
-               distance;
+               ( motion === "pos" ? "-=" : "+=" ) ) +
+               distance;
 
        // Animate
        el.animate( animation, { 
@@ -51,13 +51,14 @@ $.effects.effect.drop = function( o, done ) {
                duration: o.duration, 
                easing: o.easing, 
                complete: function() {
-                       mode == "hide" && el.hide();
+                       if ( mode === "hide" ) {
+                               el.hide();
+                       }
                        $.effects.restore( el, props ); 
                        $.effects.removeWrapper( el ); 
                        done();
                }
        });
-
 };
 
 })(jQuery);
index ea849624b6afad5e172d2729a2906cd7216a4eec..63b95275cbc7d77ca36924451a72963f51d70598 100644 (file)
@@ -30,9 +30,9 @@ $.effects.effect.puff = function( o, done ) {
                mode: mode,
                complete: done,
                percent: hide ? percent : 100,
-               from: hide
-                       ? original
-                       {
+               from: hide ?
+                       original :
+                       {
                                height: original.height * factor,
                                width: original.width * factor
                        }
@@ -47,7 +47,7 @@ $.effects.effect.scale = function( o, done ) {
        var el = $( this ),
                options = $.extend( true, {}, o ),
                mode = $.effects.setMode( el, o.mode || "effect" ),
-               percent = parseInt( o.percent, 10 ) || ( parseInt( o.percent, 10 ) == 0 ? 0 : ( mode == "hide" ? 0 : 100 ) ),
+               percent = parseInt( o.percent, 10 ) || ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode == "hide" ? 0 : 100 ) ),
                direction = o.direction || "both",
                origin = o.origin,
                original = { 
@@ -80,7 +80,8 @@ $.effects.effect.scale = function( o, done ) {
                outerWidth: original.outerWidth * factor.x
        }; 
 
-       if ( options.fade ) { // Fade option to support puff
+       // Fade option to support puff
+       if ( options.fade ) {
                if ( mode == "show" ) {
                        options.from.opacity = 0; 
                        options.to.opacity = 1;
@@ -89,7 +90,7 @@ $.effects.effect.scale = function( o, done ) {
                        options.from.opacity = 1; 
                        options.to.opacity = 0;
                }
-       };
+       }
 
        // Animate
        el.effect( options );
@@ -152,15 +153,15 @@ $.effects.effect.size = function( o, done ) {
                        props = props.concat( vProps );
                        el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
                        el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
-               };
+               }
 
                // Horizontal props scaling
                if ( factor.from.x !== factor.to.x ) { 
                        props = props.concat( hProps );
                        el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
                        el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
-               };
-       };
+               }
+       }
 
        // Scale the content
        if ( scale == "content" || scale == "both" ) { 
@@ -170,9 +171,9 @@ $.effects.effect.size = function( o, done ) {
                        props = props.concat( cProps );
                        el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
                        el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
-               };
-       };
-       
+               }
+       }
+
        $.effects.save( el, restore ? props : props1 ); 
        el.show(); 
        $.effects.createWrapper( el );
@@ -217,13 +218,13 @@ $.effects.effect.size = function( o, done ) {
                        if ( factor.from.y != factor.to.y ) { 
                                child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
                                child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
-                       };
+                       }
 
                        // Horizontal props scaling
                        if ( factor.from.x != factor.to.x ) {
                                child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
                                child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
-                       };
+                       }
 
                        // Animate children
                        child.css( child.from );
@@ -233,7 +234,7 @@ $.effects.effect.size = function( o, done ) {
                                if (restore) $.effects.restore( child, props2 ); 
                        });
                });
-       };
+       }
 
        // Animate
        el.animate( el.to, { 
index d027b740d673320ce6bf6f0fc08a0d5faa429f83..c6276d15ef3bcd665166d3bc6558b1091aa364ab 100644 (file)
@@ -49,7 +49,7 @@ $.effects.effect.shake = function( o, done ) {
        // Shakes
        for ( i = 1; i < times; i++ ) {
                el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
-       };
+       }
        el
                .animate( animation1, speed, o.easing )
                .animate( animation, speed / 2, o.easing )
index e747b2e85a77d87991a2437da7257f17acab0f29..5c8eb25669f42de98d455c97fa0de5780e24ed51 100644 (file)
@@ -44,8 +44,8 @@ $.effects.effect.slide = function( o, done ) {
        // Animation
        animation[ ref ] = ( show ? 
                ( positiveMotion ? "+=" : "-=") : 
-               ( positiveMotion ? "-=" : "+=")) 
-               distance;
+               ( positiveMotion ? "-=" : "+=")) +
+               distance;
 
        // Animate
        el.animate( animation, { 
@@ -61,7 +61,6 @@ $.effects.effect.slide = function( o, done ) {
                        done();
                }
        });
-
 };
 
 })(jQuery);
index 630d40d4e83c1ea083a5c38e6a479c524a0ef18d..92245d28e2881d639b5ca1104b04e3261a43fae2 100644 (file)
@@ -695,7 +695,7 @@ if ( $.uiBackCompat !== false ) {
                                                        easing: "easeOutBounce",
                                                        duration: 1000
                                                }
-                                       }
+                                       };
                                } else {
                                        options.animate = options.animated;
                                }
index 866ed77985a3d3ede6111cbad9d3b3f47455b4e4..07992ab2eac00da5ae274e8d8caa6044d51ebafa 100644 (file)
@@ -108,7 +108,7 @@ $.widget( "ui.autocomplete", {
                                                suppressKeyPress = true;
                                                event.preventDefault();
                                        }
-                                       //passthrough - ENTER and TAB both select the current element
+                                       // passthrough - ENTER and TAB both select the current element
                                case keyCode.TAB:
                                        if ( !self.menu.active ) {
                                                return;
@@ -270,7 +270,7 @@ $.widget( "ui.autocomplete", {
                        .data( "menu" );
 
                if ( $.fn.bgiframe ) {
-                        this.menu.element.bgiframe();
+                       this.menu.element.bgiframe();
                }
 
                // turning off autocomplete prevents the browser from remembering the
index 574256cadb6efadaaad6a0055659ee571a74091a..f66b71c6efed518881aae91538a16eb73d032732 100644 (file)
@@ -176,13 +176,13 @@ function focusable( element, isTabIndexNotNaN ) {
                img = $( "img[usemap=#" + mapName + "]" )[0];
                return !!img && visible( img );
        }
-       return ( /input|select|textarea|button|object/.test( nodeName )
-               ? !element.disabled
-               : "a" == nodeName
-                       ? element.href || isTabIndexNotNaN
-                       : isTabIndexNotNaN)
+       return ( /input|select|textarea|button|object/.test( nodeName ) ?
+               !element.disabled :
+               "a" == nodeName ?
+                       element.href || isTabIndexNotNaN :
+                       isTabIndexNotNaN) &&
                // the element and all of its ancestors must be visible
-               && visible( element );
+               visible( element );
 }
 
 function visible( element ) {
index aeffea026dee4514c15cebca8f46db9b28152d76..6d00f66aec3690fc27f46bc3deb86cf676ca3d87 100644 (file)
@@ -368,9 +368,9 @@ $.widget( "ui.menu", {
 
                var position = $.extend({}, {
                                of: this.active
-                       }, $.type(this.options.position) == "function"
-                               ? this.options.position(this.active)
-                               this.options.position
+                       }, $.type(this.options.position) == "function" ?
+                               this.options.position(this.active) :
+                               this.options.position
                        );
 
                submenu.show()
index 5e7744418e3330c04ccda783a5aaeb20d86f1cd0..53b3dcc203d4eb0aa658504d7cc533eb29c96dd2 100644 (file)
@@ -53,7 +53,7 @@ $.widget("ui.mouse", {
 
        _mouseDown: function(event) {
                // don't let more than one widget handle mouseStart
-               if( mouseHandled ) { return };
+               if( mouseHandled ) { return; }
 
                // we may have missed mouseup (out of window)
                (this._mouseStarted && this._mouseUp(event));
index c88f75f7bf5f1a7f04a4eaefa5499cdd3dd95c28..7fe31626d5fadcd1175cd7239717542357d2a56a 100644 (file)
@@ -152,13 +152,13 @@ $.fn.position = function( options ) {
                var elem = $( this ),
                        elemWidth = elem.outerWidth(),
                        elemHeight = elem.outerHeight(),
-                       marginLeft = parseInt( $.css( this, "marginLeft" ) ) || 0,
-                       marginTop = parseInt( $.css( this, "marginTop" ) ) || 0,
+                       marginLeft = parseInt( $.css( this, "marginLeft" ), 10 ) || 0,
+                       marginTop = parseInt( $.css( this, "marginTop" ), 10 ) || 0,
                        scrollInfo = $.position.getScrollInfo( within ),
                        collisionWidth = elemWidth + marginLeft +
-                               ( parseInt( $.css( this, "marginRight" ) ) || 0 ) + scrollInfo.width,
+                               ( parseInt( $.css( this, "marginRight" ), 10 ) || 0 ) + scrollInfo.width,
                        collisionHeight = elemHeight + marginTop +
-                               ( parseInt( $.css( this, "marginBottom" ) ) || 0 ) + scrollInfo.height,
+                               ( parseInt( $.css( this, "marginBottom" ), 10 ) || 0 ) + scrollInfo.height,
                        position = $.extend( {}, basePosition ),
                        myOffset = [
                                parseInt( offsets.my[ 0 ], 10 ) *
@@ -483,7 +483,7 @@ if ( $.uiBackCompat !== false ) {
                                at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ],
                                offset: undefined
                        } ) );
-               }
+               };
        }( jQuery ) );
 }
 
index d3ef33121d788d554b17a997cb13d4b2be4e175e..45888220d03d52881746e70a65b340045f09b8f0 100644 (file)
@@ -966,7 +966,7 @@ if ( $.uiBackCompat !== false ) {
                },
                _cookie: function( active ) {
                        var cookie = [ this.cookie ||
-                               ( this.cookie = this.options.cookie.name || "ui-tabs-" + ++listId ) ];
+                               ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ];
                        if ( arguments.length ) {
                                cookie.push( active === false ? -1 : active );
                                cookie.push( this.options.cookie );