Skip to content

Commit

Permalink
feat(pat stacks): Add a destroy method to unregister event handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Aug 30, 2023
1 parent a8aae63 commit 8479cfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pat/stacks/stacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class Pattern extends BasePattern {
$(this.document).on("click", "a", this._onClick.bind(this));
}

destroy() {
$(this.document).off("click", "a", this._onClick.bind(this));
}

_setupStack() {
let selected = this._currentFragment();
const $sheets = this.$el.find(this.options.selector);
Expand Down

0 comments on commit 8479cfa

Please sign in to comment.