mirror of
https://github.com/discourse/DiscoTOC.git
synced 2026-11-01 01:48:38 -05: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">
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@discourse/lint-configs": "2.0.1",
|
||||
"@discourse/lint-configs": "2.2.1",
|
||||
"ember-template-lint": "6.0.0",
|
||||
"eslint": "9.14.0",
|
||||
"prettier": "2.8.8"
|
||||
|
||||
Generated
+241
-256
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user