]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Slider problem when decimal is 0 7461/head
authorRenkas <renkas@gmail.com>
Wed, 9 Dec 2015 07:07:59 +0000 (09:07 +0200)
committerRenkas <renkas@gmail.com>
Wed, 9 Dec 2015 07:07:59 +0000 (09:07 +0200)
Fixes  #7269

We don't need to use value decimal setting for slider ui positioning.

js/foundation.slider.js

index f198c3d3a4afab347b23772dcea839f715e8fb4a..2e3de6d9da17d3fbb1cc25b96f7b9afa473f2f4f 100644 (file)
         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,