From 0335104d6eb02d0653ba91dfa27e8a0e76d05445 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Fri, 12 Aug 2011 15:24:17 -0700 Subject: [PATCH] fix slider resetting itself every time you drag it --- media/search/js/Search.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/search/js/Search.js b/media/search/js/Search.js index 5c443b0e..213c822f 100644 --- a/media/search/js/Search.js +++ b/media/search/js/Search.js @@ -82,10 +82,12 @@ SearchResult.setupUI = function() { steps = cSteps.split(',').map(function(i) { return i.toInt(); }); } + var initialStep = Math.max(0 ,steps.indexOf(cValue.get('text').toInt())); + var copiesSlider = new Slider(cSlider, cKnob, { //snap: true, steps: steps.length - 1, - initialStep: steps[cValue.get('text').toInt()] || 0, + initialStep: initialStep, onChange: function(step) { cValue.set('text', steps[step]); },