From 98691dc31128b94ba21853604e6fe02683657168 Mon Sep 17 00:00:00 2001 From: Christian Beutel <> Date: Sat, 22 Mar 2025 14:05:43 +0100 Subject: [PATCH] fixes anchor popup numbering --- web/src/routes/trail/edit/[id]/+page.svelte | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/web/src/routes/trail/edit/[id]/+page.svelte b/web/src/routes/trail/edit/[id]/+page.svelte index f388edd8..04542d7f 100644 --- a/web/src/routes/trail/edit/[id]/+page.svelte +++ b/web/src/routes/trail/edit/[id]/+page.svelte @@ -695,7 +695,12 @@ if (markerIcon) { const markerText = markerIcon.textContent ?? "0"; const markerIndex = parseInt(markerText); - markerIcon.textContent = markerIndex - 1 + ""; + const newIndex = markerIndex - 1; + markerIcon.textContent = newIndex + ""; + anchor + .marker!.getPopup() + ._content.getElementsByTagName("h5")[0].textContent = + $_("route-point") + " #" + newIndex; } } if (anchorIndex == 0) { @@ -787,7 +792,12 @@ if (markerIcon) { const markerText = markerIcon.textContent ?? "0"; const markerIndex = parseInt(markerText); - markerIcon.textContent = markerIndex + 1 + ""; + const newIndex = markerIndex + 1; + markerIcon.textContent = newIndex + ""; + anchor + .marker!.getPopup() + ._content.getElementsByTagName("h5")[0].textContent = + $_("route-point") + " #" + newIndex; } } const previousAnchor = anchors[data.segment]; @@ -885,7 +895,7 @@ async function searchTags(q: string) { const result = await tags_index(q); - tagItems = result.items.map((t) => ({ text: t.name, value: t })); + tagItems = result.items.map((t) => ({ text: t.name, value: t })); }