Skip to content

Commit c4bcd24

Browse files
committed
Spinner: Fix style issues
Closes gh-1501
1 parent bf6bbcd commit c4bcd24

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

ui/spinner.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
//>>css.structure: ../themes/base/spinner.css
1717
//>>css.theme: ../themes/base/theme.css
1818

19-
(function( factory ) {
19+
( function( factory ) {
2020
if ( typeof define === "function" && define.amd ) {
2121

2222
// AMD. Register as an anonymous module.
23-
define([
23+
define( [
2424
"jquery",
2525
"./core",
2626
"./widget",
@@ -31,7 +31,7 @@
3131
// Browser globals
3232
factory( jQuery );
3333
}
34-
}(function( $ ) {
34+
}( function( $ ) {
3535

3636
function spinner_modifier( fn ) {
3737
return function() {
@@ -96,7 +96,7 @@ return $.widget( "ui.spinner", {
9696
beforeunload: function() {
9797
this.element.removeAttr( "autocomplete" );
9898
}
99-
});
99+
} );
100100
},
101101

102102
_getCreateOptions: function() {
@@ -108,7 +108,7 @@ return $.widget( "ui.spinner", {
108108
if ( value !== undefined && value.length ) {
109109
options[ option ] = value;
110110
}
111-
});
111+
} );
112112

113113
return options;
114114
},
@@ -143,9 +143,9 @@ return $.widget( "ui.spinner", {
143143
return false;
144144
}
145145

146-
this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
146+
this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event );
147147
clearTimeout( this.mousewheelTimer );
148-
this.mousewheelTimer = this._delay(function() {
148+
this.mousewheelTimer = this._delay( function() {
149149
if ( this.spinning ) {
150150
this._stop( event );
151151
}
@@ -160,19 +160,19 @@ return $.widget( "ui.spinner", {
160160
// If the input is focused then this.previous is properly set from
161161
// when the input first received focus. If the input is not focused
162162
// then we need to set this.previous based on the value before spinning.
163-
previous = this.element[0] === $.ui.safeActiveElement( this.document[0] ) ?
163+
previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
164164
this.previous : this.element.val();
165165
function checkFocus() {
166-
var isActive = this.element[0] === $.ui.safeActiveElement( this.document[0] );
166+
var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
167167
if ( !isActive ) {
168168
this.element.focus();
169169
this.previous = previous;
170170
// support: IE
171171
// IE sets focus asynchronously, so we need to check if focus
172172
// moved off of the input because the user clicked on the button.
173-
this._delay(function() {
173+
this._delay( function() {
174174
this.previous = previous;
175-
});
175+
} );
176176
}
177177
}
178178

@@ -185,10 +185,10 @@ return $.widget( "ui.spinner", {
185185
// so we set a flag to know when we should ignore the blur event
186186
// and check (again) if focus moved off of the input.
187187
this.cancelBlur = true;
188-
this._delay(function() {
188+
this._delay( function() {
189189
delete this.cancelBlur;
190190
checkFocus.call( this );
191-
});
191+
} );
192192

193193
if ( this._start( event ) === false ) {
194194
return;
@@ -307,7 +307,7 @@ return $.widget( "ui.spinner", {
307307
i = i || 500;
308308

309309
clearTimeout( this.timer );
310-
this.timer = this._delay(function() {
310+
this.timer = this._delay( function() {
311311
this._repeat( 40, steps, event );
312312
}, i );
313313

@@ -323,7 +323,7 @@ return $.widget( "ui.spinner", {
323323

324324
value = this._adjustValue( value + step * this._increment( this.counter ) );
325325

326-
if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
326+
if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) {
327327
this._value( value );
328328
this.counter++;
329329
}
@@ -364,15 +364,15 @@ return $.widget( "ui.spinner", {
364364
base = options.min !== null ? options.min : 0;
365365
aboveMin = value - base;
366366
// - round to the nearest step
367-
aboveMin = Math.round(aboveMin / options.step) * options.step;
367+
aboveMin = Math.round( aboveMin / options.step ) * options.step;
368368
// - rounding is based on 0, so adjust back to our base
369369
value = base + aboveMin;
370370

371371
// fix precision from bad JS floating point math
372372
value = parseFloat( value.toFixed( this._precision() ) );
373373

374374
// clamp the value
375-
if ( options.max !== null && value > options.max) {
375+
if ( options.max !== null && value > options.max ) {
376376
return options.max;
377377
}
378378
if ( options.min !== null && value < options.min ) {
@@ -427,9 +427,9 @@ return $.widget( "ui.spinner", {
427427
}
428428
},
429429

430-
_setOptions: spinner_modifier(function( options ) {
430+
_setOptions: spinner_modifier( function( options ) {
431431
this._super( options );
432-
}),
432+
} ),
433433

434434
_parse: function( val ) {
435435
if ( typeof val === "string" && val !== "" ) {
@@ -449,12 +449,12 @@ return $.widget( "ui.spinner", {
449449
},
450450

451451
_refresh: function() {
452-
this.element.attr({
452+
this.element.attr( {
453453
"aria-valuemin": this.options.min,
454454
"aria-valuemax": this.options.max,
455455
// TODO: what should we do with values that can't be parsed?
456456
"aria-valuenow": this._parse( this.element.val() )
457-
});
457+
} );
458458
},
459459

460460
isValid: function() {
@@ -497,33 +497,33 @@ return $.widget( "ui.spinner", {
497497
this.uiSpinner.replaceWith( this.element );
498498
},
499499

500-
stepUp: spinner_modifier(function( steps ) {
500+
stepUp: spinner_modifier( function( steps ) {
501501
this._stepUp( steps );
502-
}),
502+
} ),
503503
_stepUp: function( steps ) {
504504
if ( this._start() ) {
505-
this._spin( (steps || 1) * this.options.step );
505+
this._spin( ( steps || 1 ) * this.options.step );
506506
this._stop();
507507
}
508508
},
509509

510-
stepDown: spinner_modifier(function( steps ) {
510+
stepDown: spinner_modifier( function( steps ) {
511511
this._stepDown( steps );
512-
}),
512+
} ),
513513
_stepDown: function( steps ) {
514514
if ( this._start() ) {
515-
this._spin( (steps || 1) * -this.options.step );
515+
this._spin( ( steps || 1 ) * -this.options.step );
516516
this._stop();
517517
}
518518
},
519519

520-
pageUp: spinner_modifier(function( pages ) {
521-
this._stepUp( (pages || 1) * this.options.page );
522-
}),
520+
pageUp: spinner_modifier( function( pages ) {
521+
this._stepUp( ( pages || 1 ) * this.options.page );
522+
} ),
523523

524-
pageDown: spinner_modifier(function( pages ) {
525-
this._stepDown( (pages || 1) * this.options.page );
526-
}),
524+
pageDown: spinner_modifier( function( pages ) {
525+
this._stepDown( ( pages || 1 ) * this.options.page );
526+
} ),
527527

528528
value: function( newVal ) {
529529
if ( !arguments.length ) {
@@ -535,6 +535,6 @@ return $.widget( "ui.spinner", {
535535
widget: function() {
536536
return this.uiSpinner;
537537
}
538-
});
538+
} );
539539

540-
}));
540+
} ) );

0 commit comments

Comments
 (0)