Skip to content
Permalink
Browse files

Slider: Count the handles after setting up a range. Fixes #7922 - Sli…

…der with range doesn't work if values are not set.
  • Loading branch information...
petersendidit authored and scottgonzalez committed Oct 16, 2012
1 parent f37008e commit dda1925d0f8d19b4baffa20259674dcef85e8bab
Showing with 3 additions and 2 deletions.
  1. +3 −2 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 );
}

0 comments on commit dda1925

Please sign in to comment.
You can’t perform that action at this time.