ui.slider - slider move with handles only, click anywhere else to be ignored

ui.slider - slider move with handles only, click anywhere else to be ignored


I had a requirement in a project that the slider is to be moved using
only the two handles that the slider has. Clicking anywhere other than
the two handles is to be ignored. The default behavior in ui.slider.js
1.5.2 is clicking on the slider moves one of the handles to where the
mouse click happens. I searched the net and looked at the ui.slider
documentation but could not locate an easy way to achieve this. Then,
Obi Von Kanobi appeared and told me to use the source; the function
"click" in ui.slider.js is designed to handle mouse clicks on the
slider at locations other than the slide handles. I put in a if
statement before line 189 that reads:
        if( !clickedHandle)
            return;
The slider now behaves the way I needed it to; one has to click on the
handle to move the slider. It would be more appropriate if this effect
could be achieved through a boolean option, e.g.,
"slideWithHandleOnly".
Sohail