- 새 _Marks 켬끔 모듈 · 다시 그림은 _Footprint scheduleRedraw 공유 - [측점] 끔 = 눈금 · 번호 · 눈금 집기 없음 · 시점 · 종점 이름표 남김 - [기울기] 끔 = 기울기 라벨 · 높이 요청 없음 - 시험 test_381_2_routeedit_marks · 도구줄 차례 시험에 두 단추 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
/* =============================================================================
|
|
* B05_Profile_UI_RouteEdit_Marks.ts
|
|
* 노선 편집 평면 [측점] [기울기] 켬끔(요구 241-11).
|
|
*
|
|
* [측점] 끔 = 측점 눈금 · 번호 안 그림 · 눈금 집기 안 함(시점 · 종점 이름표는 남음).
|
|
* [기울기] 끔 = 측점 사이 기울기 라벨 안 그림 → 높이도 안 물음.
|
|
* 켬끔은 이 페이지 동안만(기본 켬 · 계정 설정 아님) — `_Footprint` 와 같은 꼴.
|
|
* ========================================================================== */
|
|
|
|
import { scheduleRedraw } from "./B05_Profile_UI_RouteEdit_Footprint";
|
|
|
|
export type RouteEditMark = "stations" | "slopes";
|
|
|
|
const shown: Record<RouteEditMark, boolean> = { stations: true, slopes: true };
|
|
|
|
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();
|
|
});
|
|
}
|