DEV: Update linting (#102)

This commit is contained in:
David Taylor
2024-11-20 18:36:46 +01:00
committed by GitHub
parent cb57acc1ef
commit 6fce990e0d
4 changed files with 257 additions and 272 deletions
@@ -22,6 +22,16 @@ export default class TocContents extends Component {
@tracked headingPositions = [];
@tracked activeAncestorIds = [];
willDestroy() {
super.willDestroy(...arguments);
window.removeEventListener("scroll", this.updateActiveHeadingOnScroll);
window.removeEventListener("resize", this.calculateHeadingPositions);
this.appEvents.off(
"topic:current-post-changed",
this.calculateHeadingPositions
);
}
get mappedToc() {
return this.mappedTocStructure(this.args.tocStructure);
}
@@ -35,16 +45,6 @@ export default class TocContents extends Component {
this.updateActiveHeadingOnScroll(); // manual on setup so active class is added
}
willDestroy() {
super.willDestroy(...arguments);
window.removeEventListener("scroll", this.updateActiveHeadingOnScroll);
window.removeEventListener("resize", this.calculateHeadingPositions);
this.appEvents.off(
"topic:current-post-changed",
this.calculateHeadingPositions
);
}
@action
listenForScroll() {
window.addEventListener("scroll", this.updateActiveHeadingOnScroll);
@@ -6,6 +6,11 @@ import DButton from "discourse/components/d-button";
export default class TocMini extends Component {
@service tocProcessor;
willDestroy() {
super.willDestroy(...arguments);
this.removeClickOutsideListener();
}
@action
clickOutside() {
this.tocProcessor.setOverlayVisible(false);
@@ -32,11 +37,6 @@ export default class TocMini extends Component {
document.removeEventListener("click", this.clickOutside);
}
willDestroy() {
super.willDestroy(...arguments);
this.removeClickOutsideListener();
}
<template>
{{#if this.tocProcessor.hasTOC}}
<span class="d-toc-mini">