From: loficode Date: Wed, 10 Feb 2016 13:43:46 +0000 (+0200) Subject: Take start and end options to account when drawing the initial fill. X-Git-Tag: v6.2.0-rc.1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8128%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Take start and end options to account when drawing the initial fill. --- 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}%`;