A few lint fixes.

This commit is contained in:
Scott González 2012-04-02 15:55:50 -04:00
parent 3876c874e3
commit ccbfd45924
12 changed files with 55 additions and 52 deletions

View 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;
};

View 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);

View 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, {

View 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 )

View 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);

View File

@ -695,7 +695,7 @@ if ( $.uiBackCompat !== false ) {
easing: "easeOutBounce",
duration: 1000
}
}
};
} else {
options.animate = options.animated;
}

View 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

12
ui/jquery.ui.core.js vendored
View 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 ) {

View 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()

View 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));

View 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 ) );
}

View 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 );