Skip to content

Commit

Permalink
fix: clean SmoothScroll events when destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
ncoden committed Sep 28, 2018
1 parent fd14999 commit e0fbd09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/foundation.smoothScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit e0fbd09

Please # to comment.