mirror of
https://github.com/discourse/DiscoTOC.git
synced 2026-09-17 07:52:14 -04:00
DEV: Update linting (#102)
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user