]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Account for barOffset 8726/head
authorflyingL123 <leff.michael@gmail.com>
Tue, 3 May 2016 02:47:55 +0000 (22:47 -0400)
committerflyingL123 <leff.michael@gmail.com>
Tue, 3 May 2016 02:47:55 +0000 (22:47 -0400)
Account for barOffset value when setting active menu item

js/foundation.magellan.js

index ff95dc06656a74c35adb391b628d08da53b60285..64b264c71d9b5dc9e9d05f13b54b7c48c605ec47 100644 (file)
@@ -133,7 +133,7 @@ class Magellan {
       var isDown = this.scrollPos < winPos,
           _this = this,
           curVisible = this.points.filter(function(p, i){
-            return isDown ? p <= winPos : p - _this.options.threshold <= winPos;//&& winPos >= _this.points[i -1] - _this.options.threshold;
+            return isDown ? p - _this.options.barOffset <= winPos : p - _this.options.barOffset - _this.options.threshold <= winPos;
           });
       curIdx = curVisible.length ? curVisible.length - 1 : 0;
     }