From e9e70126bcc45018b8174ecf3f356ea8807087ba Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Thu, 18 May 2017 17:16:35 -0700 Subject: [PATCH] Fix issue #10020 --- js/foundation.magellan.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); } } -- 2.47.2