diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
| commit | 3443c1c65e9f1753e1e656b35d08416c1fa298f2 (patch) | |
| tree | 4e43236f460145a4d75d1b4616dcb7aa6ef08f51 /viewer/js/public.js | |
| download | worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.tar.gz worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.zip | |
worldmap-viewer: initial public history
Diffstat (limited to 'viewer/js/public.js')
| -rw-r--r-- | viewer/js/public.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/viewer/js/public.js b/viewer/js/public.js new file mode 100644 index 0000000..bb4d44c --- /dev/null +++ b/viewer/js/public.js @@ -0,0 +1,13 @@ +// public.js — what a read-only (public) map leaves out: the author's editing tabs. +export const EDIT_TABS = ['pins', 'regions', 'export']; + +export function hiddenTabs(meta) { + return meta?.read_only ? [...EDIT_TABS] : []; +} + +export function hideTabs(doc, names) { // removes each tab's button and section + for (const t of names) { + doc.querySelector(`#panel nav [data-tab="${t}"]`)?.remove(); + doc.querySelector(`#tab-${t}`)?.remove(); + } +} |
