forked from MapComplete/MapComplete
Refactoring: properly handle the hash
This commit is contained in:
parent
d6d9438bc7
commit
1ec76b66b5
8 changed files with 230 additions and 89 deletions
|
@ -4,7 +4,6 @@ import { Translation } from "../i18n/Translation"
|
|||
import { FixedUiElement } from "./FixedUiElement"
|
||||
import Title from "./Title"
|
||||
import List from "./List"
|
||||
import Hash from "../../Logic/Web/Hash"
|
||||
import Link from "./Link"
|
||||
import { Utils } from "../../Utils"
|
||||
|
||||
|
@ -43,13 +42,6 @@ export default class TableOfContents extends Combine {
|
|||
|
||||
const vis = new Link(content, "#" + title.id)
|
||||
|
||||
Hash.hash.addCallbackAndRun((h) => {
|
||||
if (h === title.id) {
|
||||
vis.SetClass("font-bold")
|
||||
} else {
|
||||
vis.RemoveClass("font-bold")
|
||||
}
|
||||
})
|
||||
els.push({ level: title.level, content: vis })
|
||||
}
|
||||
const minLevel = Math.min(...els.map((e) => e.level))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue