Skip to main content

Search and Top Navigation

#4434 closed bug (notabug)

Opened April 03, 2009 11:58PM UTC

Closed May 15, 2009 02:26AM UTC

Slider moveTo function with two handles with different ranges moves slider to wrong place

Reported by: kape Owned by:
Priority: minor Milestone: 1.8
Component: ui.slider Version: 1.5.3
Keywords: moveTo Cc:
Blocked by: Blocking:
Description

I have a slider with two handles, say cool and heat. Cool has range min: 58, max: 92, and heat has range: min 45, max: 65. In the slider options I declare cool first then heat in the handles array. Then when I call the moveTo function on the cool handle with a value higher than 65, the handle moves to 65.

On line 260 var handle = this.options.handles[this.handleIndex()]; chooses the handle, but the function handleIndex() looks for the handle in the handle object NOT in the options.handles array, and in the case above, handle[1] = cool but options.handles[0] = cool.

I've changed line 260 to this.handle[this.handleIndex()]; and the moveTo is working fine, but the slide goes past the min/max now.

Attachments (0)
Change History (4)

Changed April 06, 2009 06:55PM UTC by kape comment:1

I couldn't find the following in the documentation, and perhaps it should be added to prevent other people from having the same issue as me.

In the HTML the two sliders were in declared in the reverse order as in the slider options. Perhaps this is obvious to some, but it wasn't to me. So anyway, the HTML slider elements have to be declared or appear in the HTML in the same order in which the slider.options.handles are declared.

Changed May 07, 2009 10:47AM UTC by jzaefferer comment:2

milestone: TBD1.7.2

Looks like a documentation issue.

Changed May 07, 2009 01:38PM UTC by jzaefferer comment:3

milestone: 1.7.21.8

Changed May 15, 2009 02:26AM UTC by rdworth comment:4

resolution: → invalid
status: newclosed

The slider was completely refactored in version 1.7. The moveTo function no longer exists.