mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 16:25:01 -04:00
A few annotations and event listener removals on disconnectedCallback
This commit is contained in:
parent
6b0b368564
commit
5f32df891b
3 changed files with 25 additions and 5 deletions
|
@ -31,16 +31,21 @@ export class CCategoryLi extends HTMLElement {
|
|||
this.addEventListener("click", this.handleClick.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove listeners on disconnectedCallback
|
||||
*/
|
||||
disconnectedCallback() {
|
||||
this.removeEventListener("click", this.handleClick.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle click
|
||||
*
|
||||
* @param {Event} e
|
||||
*/
|
||||
handleClick(e) {
|
||||
// todo some event (target ) bs here
|
||||
if (e.target === this.querySelector("button")) {
|
||||
// todo back to this "hitbox" issue w the icon inside the button
|
||||
console.log(e.target);
|
||||
if (e.target === this.querySelector("button") || e.target === this.querySelector("button > i")) {
|
||||
e.stopPropagation(); // stop the event from propagating to the collapsable panel
|
||||
this.app.manager.ops.editFavouritesClick(e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue