all repos — onyx @ main

minimal map annotation and location data sharing tool

src/25-overlayManagerModal.ts (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class OverlayManagementModal implements Modal {
  self(): HTMLElement | null {
    return document.getElementById("overlays-menu-container");
  }
  
  visible(): boolean {
    return this.self()?.style.display !== "none";
  }
  
  setVisible(v: boolean): void {
    const modal = this.self();
    if (modal) {
      modal.style.display = v ? "grid" : "none";
    }
  }
  
  constructor() {
    this.setVisible(false);
  }
}