Skip to content

Commit ccbfd45

Browse files
committed
A few lint fixes.
1 parent 3876c87 commit ccbfd45

12 files changed

+55
-52
lines changed

ui/jquery.effects.core.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopS
171171
});
172172

173173
function getElementStyles() {
174-
var style = this.ownerDocument.defaultView
175-
? this.ownerDocument.defaultView.getComputedStyle( this, null )
176-
: this.currentStyle,
174+
var style = this.ownerDocument.defaultView ?
175+
this.ownerDocument.defaultView.getComputedStyle( this, null ) :
176+
this.currentStyle,
177177
newStyle = {},
178178
key,
179179
camelCase,
@@ -375,13 +375,13 @@ $.extend( $.effects, {
375375
case "middle": y = 0.5; break;
376376
case "bottom": y = 1; break;
377377
default: y = origin[ 0 ] / original.height;
378-
};
378+
}
379379
switch ( origin[ 1 ] ) {
380380
case "left": x = 0; break;
381381
case "center": x = 0.5; break;
382382
case "right": x = 1; break;
383383
default: x = origin[ 1 ] / original.width;
384-
};
384+
}
385385
return {
386386
x: x,
387387
y: y
@@ -523,8 +523,10 @@ function _normalizeArguments( effect, options, speed, callback ) {
523523
}
524524

525525
speed = speed || options.duration;
526-
effect.duration = $.fx.off ? 0 : typeof speed === "number"
527-
? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
526+
effect.duration = $.fx.off ? 0 :
527+
typeof speed === "number" ? speed :
528+
speed in $.fx.speeds ? $.fx.speeds[ speed ] :
529+
$.fx.speeds._default;
528530

529531
effect.complete = callback || options.complete;
530532

@@ -701,7 +703,7 @@ $.each( baseEasings, function( name, easeIn ) {
701703
return 1 - easeIn( 1 - p );
702704
};
703705
$.easing[ "easeInOut" + name ] = function( p ) {
704-
return p < .5 ?
706+
return p < 0.5 ?
705707
easeIn( p * 2 ) / 2 :
706708
easeIn( p * -2 + 2 ) / -2 + 1;
707709
};

ui/jquery.effects.drop.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,34 @@ $.effects.effect.drop = function( o, done ) {
3131
el.show();
3232
$.effects.createWrapper( el );
3333

34-
distance = o.distance || el[ ref == "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2;
34+
distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]({ margin: true }) / 2;
3535

3636
if ( show ) {
3737
el
3838
.css( "opacity", 0 )
39-
.css( ref, motion == "pos" ? -distance : distance );
39+
.css( ref, motion === "pos" ? -distance : distance );
4040
}
4141

4242
// Animation
4343
animation[ ref ] = ( show ?
4444
( motion === "pos" ? "+=" : "-=" ) :
45-
( motion === "pos" ? "-=" : "+=" ) )
46-
+ distance;
45+
( motion === "pos" ? "-=" : "+=" ) ) +
46+
distance;
4747

4848
// Animate
4949
el.animate( animation, {
5050
queue: false,
5151
duration: o.duration,
5252
easing: o.easing,
5353
complete: function() {
54-
mode == "hide" && el.hide();
54+
if ( mode === "hide" ) {
55+
el.hide();
56+
}
5557
$.effects.restore( el, props );
5658
$.effects.removeWrapper( el );
5759
done();
5860
}
5961
});
60-
6162
};
6263

6364
})(jQuery);

ui/jquery.effects.scale.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ $.effects.effect.puff = function( o, done ) {
3030
mode: mode,
3131
complete: done,
3232
percent: hide ? percent : 100,
33-
from: hide
34-
? original
35-
: {
33+
from: hide ?
34+
original :
35+
{
3636
height: original.height * factor,
3737
width: original.width * factor
3838
}
@@ -47,7 +47,7 @@ $.effects.effect.scale = function( o, done ) {
4747
var el = $( this ),
4848
options = $.extend( true, {}, o ),
4949
mode = $.effects.setMode( el, o.mode || "effect" ),
50-
percent = parseInt( o.percent, 10 ) || ( parseInt( o.percent, 10 ) == 0 ? 0 : ( mode == "hide" ? 0 : 100 ) ),
50+
percent = parseInt( o.percent, 10 ) || ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode == "hide" ? 0 : 100 ) ),
5151
direction = o.direction || "both",
5252
origin = o.origin,
5353
original = {
@@ -80,7 +80,8 @@ $.effects.effect.scale = function( o, done ) {
8080
outerWidth: original.outerWidth * factor.x
8181
};
8282

83-
if ( options.fade ) { // Fade option to support puff
83+
// Fade option to support puff
84+
if ( options.fade ) {
8485
if ( mode == "show" ) {
8586
options.from.opacity = 0;
8687
options.to.opacity = 1;
@@ -89,7 +90,7 @@ $.effects.effect.scale = function( o, done ) {
8990
options.from.opacity = 1;
9091
options.to.opacity = 0;
9192
}
92-
};
93+
}
9394

9495
// Animate
9596
el.effect( options );
@@ -152,15 +153,15 @@ $.effects.effect.size = function( o, done ) {
152153
props = props.concat( vProps );
153154
el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
154155
el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
155-
};
156+
}
156157

157158
// Horizontal props scaling
158159
if ( factor.from.x !== factor.to.x ) {
159160
props = props.concat( hProps );
160161
el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
161162
el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
162-
};
163-
};
163+
}
164+
}
164165

165166
// Scale the content
166167
if ( scale == "content" || scale == "both" ) {
@@ -170,9 +171,9 @@ $.effects.effect.size = function( o, done ) {
170171
props = props.concat( cProps );
171172
el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
172173
el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
173-
};
174-
};
175-
174+
}
175+
}
176+
176177
$.effects.save( el, restore ? props : props1 );
177178
el.show();
178179
$.effects.createWrapper( el );
@@ -217,13 +218,13 @@ $.effects.effect.size = function( o, done ) {
217218
if ( factor.from.y != factor.to.y ) {
218219
child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
219220
child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
220-
};
221+
}
221222

222223
// Horizontal props scaling
223224
if ( factor.from.x != factor.to.x ) {
224225
child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
225226
child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
226-
};
227+
}
227228

228229
// Animate children
229230
child.css( child.from );
@@ -233,7 +234,7 @@ $.effects.effect.size = function( o, done ) {
233234
if (restore) $.effects.restore( child, props2 );
234235
});
235236
});
236-
};
237+
}
237238

238239
// Animate
239240
el.animate( el.to, {

ui/jquery.effects.shake.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $.effects.effect.shake = function( o, done ) {
4949
// Shakes
5050
for ( i = 1; i < times; i++ ) {
5151
el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
52-
};
52+
}
5353
el
5454
.animate( animation1, speed, o.easing )
5555
.animate( animation, speed / 2, o.easing )

ui/jquery.effects.slide.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ $.effects.effect.slide = function( o, done ) {
4444
// Animation
4545
animation[ ref ] = ( show ?
4646
( positiveMotion ? "+=" : "-=") :
47-
( positiveMotion ? "-=" : "+="))
48-
+ distance;
47+
( positiveMotion ? "-=" : "+=")) +
48+
distance;
4949

5050
// Animate
5151
el.animate( animation, {
@@ -61,7 +61,6 @@ $.effects.effect.slide = function( o, done ) {
6161
done();
6262
}
6363
});
64-
6564
};
6665

6766
})(jQuery);

ui/jquery.ui.accordion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ if ( $.uiBackCompat !== false ) {
695695
easing: "easeOutBounce",
696696
duration: 1000
697697
}
698-
}
698+
};
699699
} else {
700700
options.animate = options.animated;
701701
}

ui/jquery.ui.autocomplete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ $.widget( "ui.autocomplete", {
108108
suppressKeyPress = true;
109109
event.preventDefault();
110110
}
111-
//passthrough - ENTER and TAB both select the current element
111+
// passthrough - ENTER and TAB both select the current element
112112
case keyCode.TAB:
113113
if ( !self.menu.active ) {
114114
return;
@@ -270,7 +270,7 @@ $.widget( "ui.autocomplete", {
270270
.data( "menu" );
271271

272272
if ( $.fn.bgiframe ) {
273-
this.menu.element.bgiframe();
273+
this.menu.element.bgiframe();
274274
}
275275

276276
// turning off autocomplete prevents the browser from remembering the

ui/jquery.ui.core.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ function focusable( element, isTabIndexNotNaN ) {
176176
img = $( "img[usemap=#" + mapName + "]" )[0];
177177
return !!img && visible( img );
178178
}
179-
return ( /input|select|textarea|button|object/.test( nodeName )
180-
? !element.disabled
181-
: "a" == nodeName
182-
? element.href || isTabIndexNotNaN
183-
: isTabIndexNotNaN)
179+
return ( /input|select|textarea|button|object/.test( nodeName ) ?
180+
!element.disabled :
181+
"a" == nodeName ?
182+
element.href || isTabIndexNotNaN :
183+
isTabIndexNotNaN) &&
184184
// the element and all of its ancestors must be visible
185-
&& visible( element );
185+
visible( element );
186186
}
187187

188188
function visible( element ) {

ui/jquery.ui.menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,9 @@ $.widget( "ui.menu", {
368368

369369
var position = $.extend({}, {
370370
of: this.active
371-
}, $.type(this.options.position) == "function"
372-
? this.options.position(this.active)
373-
: this.options.position
371+
}, $.type(this.options.position) == "function" ?
372+
this.options.position(this.active) :
373+
this.options.position
374374
);
375375

376376
submenu.show()

ui/jquery.ui.mouse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ $.widget("ui.mouse", {
5353

5454
_mouseDown: function(event) {
5555
// don't let more than one widget handle mouseStart
56-
if( mouseHandled ) { return };
56+
if( mouseHandled ) { return; }
5757

5858
// we may have missed mouseup (out of window)
5959
(this._mouseStarted && this._mouseUp(event));

ui/jquery.ui.position.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ $.fn.position = function( options ) {
152152
var elem = $( this ),
153153
elemWidth = elem.outerWidth(),
154154
elemHeight = elem.outerHeight(),
155-
marginLeft = parseInt( $.css( this, "marginLeft" ) ) || 0,
156-
marginTop = parseInt( $.css( this, "marginTop" ) ) || 0,
155+
marginLeft = parseInt( $.css( this, "marginLeft" ), 10 ) || 0,
156+
marginTop = parseInt( $.css( this, "marginTop" ), 10 ) || 0,
157157
scrollInfo = $.position.getScrollInfo( within ),
158158
collisionWidth = elemWidth + marginLeft +
159-
( parseInt( $.css( this, "marginRight" ) ) || 0 ) + scrollInfo.width,
159+
( parseInt( $.css( this, "marginRight" ), 10 ) || 0 ) + scrollInfo.width,
160160
collisionHeight = elemHeight + marginTop +
161-
( parseInt( $.css( this, "marginBottom" ) ) || 0 ) + scrollInfo.height,
161+
( parseInt( $.css( this, "marginBottom" ), 10 ) || 0 ) + scrollInfo.height,
162162
position = $.extend( {}, basePosition ),
163163
myOffset = [
164164
parseInt( offsets.my[ 0 ], 10 ) *
@@ -483,7 +483,7 @@ if ( $.uiBackCompat !== false ) {
483483
at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ],
484484
offset: undefined
485485
} ) );
486-
}
486+
};
487487
}( jQuery ) );
488488
}
489489

ui/jquery.ui.tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ if ( $.uiBackCompat !== false ) {
966966
},
967967
_cookie: function( active ) {
968968
var cookie = [ this.cookie ||
969-
( this.cookie = this.options.cookie.name || "ui-tabs-" + ++listId ) ];
969+
( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ];
970970
if ( arguments.length ) {
971971
cookie.push( active === false ? -1 : active );
972972
cookie.push( this.options.cookie );

0 commit comments

Comments
 (0)