Skip to content

Commit dda1925

Browse files
petersendiditscottgonzalez
authored andcommitted
Slider: Count the handles after setting up a range. Fixes #7922 - Slider with range doesn't work if values are not set.
1 parent f37008e commit dda1925

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/jquery.ui.slider.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ $.widget( "ui.slider", $.ui.mouse, {
3636
},
3737

3838
_create: function() {
39-
var i,
39+
var i, handleCount,
4040
o = this.options,
4141
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
4242
handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
43-
handleCount = ( o.values && o.values.length ) || 1,
4443
handles = [];
4544

4645
this._keySliding = false;
@@ -79,6 +78,8 @@ $.widget( "ui.slider", $.ui.mouse, {
7978
( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
8079
}
8180

81+
handleCount = ( o.values && o.values.length ) || 1;
82+
8283
for ( i = existingHandles.length; i < handleCount; i++ ) {
8384
handles.push( handle );
8485
}

0 commit comments

Comments
 (0)