From 0b766e6a0c6805643739a61cf79d9fd32a4adf46 Mon Sep 17 00:00:00 2001 From: loficode Date: Wed, 10 Feb 2016 15:43:46 +0200 Subject: [PATCH] Take start and end options to account when drawing the initial fill. --- js/foundation.slider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/foundation.slider.js b/js/foundation.slider.js index c8e59291a..82c44c44a 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -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}%`; -- 2.47.2