From 8479cfa170a20a863d36b65309c9706f67b33bd9 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 29 Aug 2023 20:01:40 +0200 Subject: [PATCH] feat(pat stacks): Add a destroy method to unregister event handlers. --- src/pat/stacks/stacks.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pat/stacks/stacks.js b/src/pat/stacks/stacks.js index 3c8a8ef28..29c197b22 100644 --- a/src/pat/stacks/stacks.js +++ b/src/pat/stacks/stacks.js @@ -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);