diff --git a/public/js/map-ui.js b/public/js/map-ui.js index a181f46..dbe913d 100644 --- a/public/js/map-ui.js +++ b/public/js/map-ui.js @@ -9,16 +9,20 @@ const tooltip = document.getElementById("map-tooltip"); const tooltipCache = {}; /* ================================ - Gaststätte Popup + Gaststätte Popup soll hier aufgehen ================================ */ const gaststaettePopup = document.getElementById("gaststaette-popup"); -const qmOverlay = document.getElementById("qm-overlay"); +const qmOverlay = document.getElementById("qm-overlay"); document.querySelectorAll(".gaststaette-tab").forEach((tab) => { tab.addEventListener("click", () => { - document.querySelectorAll(".gaststaette-tab").forEach((t) => t.classList.remove("active")); - document.querySelectorAll(".gaststaette-tab-content").forEach((c) => c.classList.remove("active")); + document + .querySelectorAll(".gaststaette-tab") + .forEach((t) => t.classList.remove("active")); + document + .querySelectorAll(".gaststaette-tab-content") + .forEach((c) => c.classList.remove("active")); tab.classList.add("active"); document.getElementById(tab.dataset.tab).classList.add("active"); }); @@ -179,7 +183,7 @@ document.querySelectorAll(".building").forEach((building) => { // Gebäude 6 → Gaststätte eigenes Popup if (url === "/building/6") { gaststaettePopup.style.left = "50%"; - gaststaettePopup.style.top = "50%"; + gaststaettePopup.style.top = "50%"; gaststaettePopup.style.transform = "translate(-50%, -50%) scale(1)"; gaststaettePopup.classList.add("active"); qmOverlay.classList.add("active"); @@ -277,7 +281,8 @@ document.querySelectorAll(".building").forEach((building) => { building.addEventListener("mouseenter", async (e) => { try { // data-id bevorzugen, sonst ID aus href extrahieren (z.B. "/building/5" → "5") - const id = building.dataset.id || building.getAttribute("href")?.split("/").pop(); + const id = + building.dataset.id || building.getAttribute("href")?.split("/").pop(); if (!id) return; if (!tooltipCache[id]) {