From: Renkas Date: Wed, 9 Dec 2015 07:07:59 +0000 (+0200) Subject: Slider problem when decimal is 0 X-Git-Tag: v6.0.6~54^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7461%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Slider problem when decimal is 0 Fixes #7269 We don't need to use value decimal setting for slider ui positioning. --- diff --git a/js/foundation.slider.js b/js/foundation.slider.js index f198c3d3a..2e3de6d9d 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -222,7 +222,7 @@ lOrT = vert ? 'top' : 'left', halfOfHandle = $hndl[0].getBoundingClientRect()[hOrW] / 2, elemDim = this.$element[0].getBoundingClientRect()[hOrW], - pctOfBar = percent(location, this.options.end).toFixed(this.options.decimal), + pctOfBar = percent(location, this.options.end).toFixed(2), pxToMove = (elemDim - halfOfHandle) * pctOfBar, movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal), location = location > 0 ? parseFloat(location.toFixed(this.options.decimal)) : 0,