Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienheureux committed Oct 22, 2024
1 parent f320a4e commit e048df6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion static/to_compile/src/map_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export default class extends Controller<HTMLElement> {
}

actorsMap.initEventListener()

window.addEventListener("hashchange", this.setActiveActor.bind(this))
}

initialize() {
Expand All @@ -73,7 +75,15 @@ export default class extends Controller<HTMLElement> {
this.searchInZoneButtonTarget.classList.add("qfdmo-hidden")
}

#displayActeur(identifiantUnique: string) {
setActiveActor(event?: HashChangeEvent) {
const identifiantUnique = event
? new URL(event.newURL).hash.substring(1)
: window.location.hash.substring(1)

if (!identifiantUnique) {
// TODO: gérer le cas où on a plus de hash dans l'URL
}

// TODO: react on hash change
this.dispatch("displayDetails", { detail: {} })
this.dispatch("setSrcDetailsAddress", {
Expand Down

0 comments on commit e048df6

Please sign in to comment.