/* ============================================================================= * B05_Profile_UI_RouteEdit_Marks.ts * 노선 편집 평면 [측점] [기울기] 켬끔(요구 241-11). * * [측점] 끔 = 측점 눈금 · 번호 안 그림 · 눈금 집기 안 함(시점 · 종점 이름표는 남음). * [기울기] 끔 = 측점 사이 기울기 라벨 안 그림 → 높이도 안 물음. * 켬끔은 이 페이지 동안만(기본 [측점] 켬 · [기울기] 끔(요구 242-17) · 계정 설정 아님) — `_Footprint` 와 같은 꼴. * ========================================================================== */ import { scheduleRedraw } from "./B05_Profile_UI_RouteEdit_Footprint"; export type RouteEditMark = "stations" | "slopes"; const shown: Record = { stations: true, slopes: false }; export const markShown = (mark: RouteEditMark): boolean => shown[mark]; /** [측점] · [기울기] 단추 — 누르면 켬끔 · 다시 그림. */ export function bindMarkToggle(button: HTMLButtonElement, mark: RouteEditMark): void { const paint = (): void => { button.classList.toggle("is-active", shown[mark]); button.setAttribute("aria-pressed", String(shown[mark])); }; paint(); button.addEventListener("click", () => { shown[mark] = !shown[mark]; paint(); scheduleRedraw(); }); }