]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Set max normalized percentage value to 1 5617/head
authorDaniel Molina <dmamolina@gmail.com>
Thu, 14 Aug 2014 14:57:25 +0000 (16:57 +0200)
committerDaniel Molina <dmamolina@gmail.com>
Thu, 14 Aug 2014 14:57:25 +0000 (16:57 +0200)
If a value greater than the end value is set for the range slider, the handle and bar width should not be greater than the container

js/foundation/foundation.slider.js

index cbbd18fa22944c0ab920f24e24120e7dd915f47f..b97fa6b9e5b84d39850ca5de959be7d73f2be930 100755 (executable)
     },
 
     normalized_percentage : function(val, start, end) {
-      return (val - start)/(end - start);
+      return Math.min(1, (val - start)/(end - start));
     },
 
     normalized_value : function(val, start, end, step) {