Skip to content

Commit

Permalink
Spinner: Prefix variables with component name.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgonzalez committed Oct 24, 2013
1 parent 47db52b commit 5801a7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ui/jquery.ui.slider.js
Expand Up @@ -638,7 +638,8 @@ $.widget( "ui.slider", $.ui.mouse, {
break;
case $.ui.keyCode.PAGE_UP:
newVal = this._trimAlignValue(
curVal + ( (this._valueMax() - this._valueMin()) / this.numPages ) );
curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
);
break;
case $.ui.keyCode.PAGE_DOWN:
newVal = this._trimAlignValue(
Expand Down
14 changes: 7 additions & 7 deletions ui/jquery.ui.spinner.js
Expand Up @@ -15,7 +15,7 @@
*/
(function( $ ) {

function modifier( fn ) {
function spinner_modifier( fn ) {
return function() {
var previous = this.element.val();
fn.apply( this, arguments );
Expand Down Expand Up @@ -391,7 +391,7 @@ $.widget( "ui.spinner", {
}
},

_setOptions: modifier(function( options ) {
_setOptions: spinner_modifier(function( options ) {
this._super( options );
this._value( this.element.val() );
}),
Expand Down Expand Up @@ -462,7 +462,7 @@ $.widget( "ui.spinner", {
this.uiSpinner.replaceWith( this.element );
},

stepUp: modifier(function( steps ) {
stepUp: spinner_modifier(function( steps ) {
this._stepUp( steps );
}),
_stepUp: function( steps ) {
Expand All @@ -472,7 +472,7 @@ $.widget( "ui.spinner", {
}
},

stepDown: modifier(function( steps ) {
stepDown: spinner_modifier(function( steps ) {
this._stepDown( steps );
}),
_stepDown: function( steps ) {
Expand All @@ -482,19 +482,19 @@ $.widget( "ui.spinner", {
}
},

pageUp: modifier(function( pages ) {
pageUp: spinner_modifier(function( pages ) {
this._stepUp( (pages || 1) * this.options.page );
}),

pageDown: modifier(function( pages ) {
pageDown: spinner_modifier(function( pages ) {
this._stepDown( (pages || 1) * this.options.page );
}),

value: function( newVal ) {
if ( !arguments.length ) {
return this._parse( this.element.val() );
}
modifier( this._value ).call( this, newVal );
spinner_modifier( this._value ).call( this, newVal );
},

widget: function() {
Expand Down

0 comments on commit 5801a7e

Please sign in to comment.