From e0fbd09c8f403f66ed566de24b5e45b22797cf75 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Fri, 28 Sep 2018 22:50:10 +0200 Subject: [PATCH] fix: clean SmoothScroll events when destroyed --- js/foundation.smoothScroll.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/foundation.smoothScroll.js b/js/foundation.smoothScroll.js index 9d5f9c656..ce8eda919 100644 --- a/js/foundation.smoothScroll.js +++ b/js/foundation.smoothScroll.js @@ -91,6 +91,15 @@ class SmoothScroll extends Plugin { } ); } + + /** + * Destroys the SmoothScroll instance. + * @function + */ + _destroy() { + this.$element.off('click.zf.smoothScroll', this._handleLinkClick) + this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._handleLinkClick); + } } /** -- 2.47.2