From: Kevin Ball Date: Fri, 19 May 2017 00:16:35 +0000 (-0700) Subject: Fix issue #10020 X-Git-Tag: v6.4.0-rc1~37^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9e70126bcc45018b8174ecf3f356ea8807087ba;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix issue #10020 --- diff --git a/js/foundation.magellan.js b/js/foundation.magellan.js index d2a8fb05c..1313fedf9 100644 --- a/js/foundation.magellan.js +++ b/js/foundation.magellan.js @@ -99,11 +99,14 @@ class Magellan extends Plugin { var arrival = this.getAttribute('href'); _this.scrollToLoc(arrival); }); - $(window).on('popstate', function(e) { + + this._deepLinkScroll = function(e) { if(_this.options.deepLinking) { _this.scrollToLoc(window.location.hash); } - }); + }; + + $(window).on('popstate', this._deepLinkScroll); } /** @@ -196,6 +199,7 @@ class Magellan extends Plugin { var hash = this.$active[0].getAttribute('href'); window.location.hash.replace(hash, ''); } + $(window).off('popstate', this._deepLinkScroll); } }