aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.slider.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-09-17 09:41:20 -0400
committerScott González <scott.gonzalez@gmail.com>2013-10-24 09:19:41 -0400
commit8dbda00896adb7bd7ce74506e4fb1a474dd13e3c (patch)
tree124ebb4937770197030c0278898586abe05da023 /ui/jquery.ui.slider.js
parent3317ec89907bceeeb4c10d7bea9d50b06c560f84 (diff)
downloadjquery-ui-8dbda00896adb7bd7ce74506e4fb1a474dd13e3c.tar.gz
jquery-ui-8dbda00896adb7bd7ce74506e4fb1a474dd13e3c.zip
Slider: Move numPages into the widget prototype.
Diffstat (limited to 'ui/jquery.ui.slider.js')
-rw-r--r--ui/jquery.ui.slider.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index df71f363f..c2398b881 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -15,10 +15,6 @@
*/
(function( $, undefined ) {
-// number of pages in a slider
-// (how many times can you page up/down to go through the whole range)
-var numPages = 5;
-
$.widget( "ui.slider", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "slide",
@@ -41,6 +37,10 @@ $.widget( "ui.slider", $.ui.mouse, {
stop: null
},
+ // number of pages in a slider
+ // (how many times can you page up/down to go through the whole range)
+ numPages: 5,
+
_create: function() {
this._keySliding = false;
this._mouseSliding = false;
@@ -637,10 +637,12 @@ $.widget( "ui.slider", $.ui.mouse, {
newVal = this._valueMax();
break;
case $.ui.keyCode.PAGE_UP:
- newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );
+ newVal = this._trimAlignValue(
+ curVal + ( (this._valueMax() - this._valueMin()) / this.numPages ) );
break;
case $.ui.keyCode.PAGE_DOWN:
- newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );
+ newVal = this._trimAlignValue(
+ curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
break;
case $.ui.keyCode.UP:
case $.ui.keyCode.RIGHT:
@@ -674,7 +676,6 @@ $.widget( "ui.slider", $.ui.mouse, {
}
}
}
-
});
}(jQuery));