Skip to content

Commit

Permalink
Slider: Count the handles after setting up a range. Fixes #7922 - Sli…
Browse files Browse the repository at this point in the history
…der with range doesn't work if values are not set.
  • Loading branch information
petersendidit authored and scottgonzalez committed Oct 18, 2012
1 parent f37008e commit dda1925
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/jquery.ui.slider.js
Expand Up @@ -36,11 +36,10 @@ $.widget( "ui.slider", $.ui.mouse, {
}, },


_create: function() { _create: function() {
var i, var i, handleCount,
o = this.options, o = this.options,
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), 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>", handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
handleCount = ( o.values && o.values.length ) || 1,
handles = []; handles = [];


this._keySliding = false; this._keySliding = false;
Expand Down Expand Up @@ -79,6 +78,8 @@ $.widget( "ui.slider", $.ui.mouse, {
( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); ( ( 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++ ) { for ( i = existingHandles.length; i < handleCount; i++ ) {
handles.push( handle ); handles.push( handle );
} }
Expand Down

0 comments on commit dda1925

Please sign in to comment.