diff --git a/web/static/app.js b/web/static/app.js index 78c3b97..72f645a 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -22,6 +22,7 @@ let routeMasterLayers = []; // coloured polylines when viewing a route_master // ── State ───────────────────────────────────────────────────────────────── +const DEFAULT_TITLE = document.title; let currentRelationId = RELATION_ID; // tracks the currently loaded relation let routeData = null; // response from /api/route/ let segmentGeoJson = null; // last response from /api/segment/ (always includes stops) @@ -349,6 +350,7 @@ async function loadRoute(relationId) { // Show route panel document.getElementById('route-panel').classList.remove('d-none'); document.getElementById('route-name').textContent = data.name; + document.title = `${data.name} – ${DEFAULT_TITLE}`; document.getElementById('route-osm-link').href = `https://www.openstreetmap.org/relation/${relationId}`; @@ -437,6 +439,7 @@ async function loadRouteMaster(relationId) { document.getElementById('route-panel').classList.add('d-none'); document.getElementById('route-master-panel').classList.remove('d-none'); document.getElementById('route-master-name').textContent = data.name; + document.title = `${data.name} – ${DEFAULT_TITLE}`; document.getElementById('route-master-osm-link').href = `https://www.openstreetmap.org/relation/${relationId}`;