aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.slider.js
diff options
context:
space:
mode:
authorDavid Petersen <public@petersendidit.com>2012-10-16 14:07:10 -0400
committerScott González <scott.gonzalez@gmail.com>2012-10-17 20:08:50 -0400
commitdda1925d0f8d19b4baffa20259674dcef85e8bab (patch)
tree3a004fc4075b2a2b519952f6dc0b4e84850350ad /ui/jquery.ui.slider.js
parentf37008eeb11eb12571cb65b1010a7e5d367064ac (diff)
downloadjquery-ui-dda1925d0f8d19b4baffa20259674dcef85e8bab.tar.gz
jquery-ui-dda1925d0f8d19b4baffa20259674dcef85e8bab.zip
Slider: Count the handles after setting up a range. Fixes #7922 - Slider with range doesn't work if values are not set.
Diffstat (limited to 'ui/jquery.ui.slider.js')
-rw-r--r--ui/jquery.ui.slider.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index ab8287e7b..eb0f7fc15 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -36,11 +36,10 @@ $.widget( "ui.slider", $.ui.mouse, {
},
_create: function() {
- var i,
+ var i, handleCount,
o = this.options,
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
- handleCount = ( o.values && o.values.length ) || 1,
handles = [];
this._keySliding = false;
@@ -79,6 +78,8 @@ $.widget( "ui.slider", $.ui.mouse, {
( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
}
+ handleCount = ( o.values && o.values.length ) || 1;
+
for ( i = existingHandles.length; i < handleCount; i++ ) {
handles.push( handle );
}