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))
|
||||
|
|
|
@ -30,7 +30,6 @@ import OpeningHoursVisualization from "./OpeningHours/OpeningHoursVisualization"
|
|||
import LiveQueryHandler from "../Logic/Web/LiveQueryHandler"
|
||||
import {SubtleButton} from "./Base/SubtleButton"
|
||||
import Svg from "../Svg"
|
||||
import Hash from "../Logic/Web/Hash"
|
||||
import NoteCommentElement from "./Popup/NoteCommentElement"
|
||||
import ImgurUploader from "../Logic/ImageProviders/ImgurUploader"
|
||||
import FileSelectorButton from "./Input/FileSelectorButton"
|
||||
|
@ -913,7 +912,7 @@ export default class SpecialVisualizations {
|
|||
Translations.t.general.removeLocationHistory
|
||||
).onClick(() => {
|
||||
state.historicalUserLocations.features.setData([])
|
||||
Hash.hash.setData(undefined)
|
||||
state.selectedElement.setData(undefined)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue