]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Take start and end options to account when drawing the initial fill. 8128/head
authorloficode <akurkinen@luukku.com>
Wed, 10 Feb 2016 13:43:46 +0000 (15:43 +0200)
committerloficode <akurkinen@luukku.com>
Wed, 10 Feb 2016 13:43:46 +0000 (15:43 +0200)
js/foundation.slider.js

index c8e59291a210b0211389653a18e2ed64fabc614c..82c44c44a003746e591866011b21e4be61d26803 100644 (file)
@@ -168,7 +168,7 @@ export default class Slider {
         var handlePos = parseFloat(this.$handle[0].style[lOrT]);
         //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0
         //based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself
-        dim = movement - (isNaN(handlePos) ? this.options.initialStart : handlePos) + handlePct;
+        dim = movement - (isNaN(handlePos) ? this.options.initialStart/((this.options.end-this.options.start)/100) : handlePos) + handlePct;
       }
       // assign the min-height/width to our css object
       css[`min-${hOrW}`] = `${dim}%`;