From: Nicolas Coden Date: Fri, 28 Sep 2018 20:50:10 +0000 (+0200) Subject: fix: clean SmoothScroll events when destroyed X-Git-Tag: v6.6.0~3^2~89^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0fbd09c8;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: clean SmoothScroll events when destroyed --- 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); + } } /**