From: Rawikitua Isherwood Date: Sat, 8 Oct 2016 08:22:27 +0000 (+1300) Subject: Fix for Magellan issue #7308 X-Git-Tag: v6.3-rc1~47^2~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c411aa8a75dd1d248197d9f0ec6a0073e3a5f39;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix for Magellan issue #7308 Now works with deep linking --- diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index b9ab4dfa4..187984f65 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -130,7 +130,7 @@ class Magellan { curIdx; if(winPos + this.winHeight === this.docHeight){ curIdx = this.points.length - 1; } - else if(winPos < this.points[0]){ curIdx = 0; } + else if(winPos < this.points[0]){ curIdx = undefined; } else{ var isDown = this.scrollPos < winPos, _this = this, @@ -144,7 +144,10 @@ class Magellan { this.$active = this.$links.filter('[href="#' + this.$targets.eq(curIdx).data('magellan-target') + '"]').addClass(this.options.activeClass); if(this.options.deepLinking){ - var hash = this.$active[0].getAttribute('href'); + var hash = " "; + if(curIdx != undefined){ + hash = this.$active[0].getAttribute('href'); + } if(window.history.pushState){ window.history.pushState(null, null, hash); }else{