Move various tabs into buttons, more work on a11y

This commit is contained in:
Pieter Vander Vennet 2023-12-20 02:50:08 +01:00
parent cce9b879f2
commit 7e852dd7e3
29 changed files with 10642 additions and 10432 deletions

View file

@ -34,7 +34,8 @@ export class MenuState {
new UIEventSource<boolean>(false)
public readonly filtersPanelIsOpened: UIEventSource<boolean> = new UIEventSource<boolean>(false)
public readonly privacyPanelIsOpened: UIEventSource<boolean> = new UIEventSource<boolean>(false)
public readonly communityIndexPanelIsOpened: UIEventSource<boolean> = new UIEventSource(false)
public readonly allToggles: {
toggle: UIEventSource<boolean>
name: string
@ -151,13 +152,21 @@ export class MenuState {
*/
public closeAll(): boolean {
const toggles = [
this.menuIsOpened,
this.themeIsOpened,
this.communityIndexPanelIsOpened,
this.privacyPanelIsOpened,
this.backgroundLayerSelectionIsOpened,
this.filtersPanelIsOpened,
this.menuIsOpened,
this.themeIsOpened,
]
const somethingIsOpen = toggles.some((t) => t.data)
toggles.forEach((t) => t.setData(false))
let somethingIsOpen = false
for (const t of toggles) {
somethingIsOpen = t.data
t.setData(false)
if (somethingIsOpen) {
break
}
}
return somethingIsOpen
}
}