From 73998b094b5705adfc23d521b3b250070722c889 Mon Sep 17 00:00:00 2001 From: Julian Pustkuchen Date: Thu, 28 May 2020 17:06:32 +0200 Subject: [PATCH] Magellan with data-offset does not trigger correctly on the first item #11754 Magellan with data-offset does not trigger correctly on the first item #11754 --- js/foundation.magellan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index 441efd40f..9ddb6aa88 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -162,7 +162,7 @@ class Magellan extends Plugin { let activeIdx; // Before the first point: no link - if(newScrollPos < this.points[0]){ /* do nothing */ } + if(newScrollPos < this.points[0] - this.options.offset - (isScrollingUp ? this.options.threshold : 0)){ /* do nothing */ } // At the bottom of the page: last link else if(newScrollPos + this.winHeight === this.docHeight){ activeIdx = this.points.length - 1; } // Otherwhise, use the last visible link -- 2.47.2