This commit is contained in:
cay 2026-04-10 11:45:40 +01:00
parent de0239c72d
commit 6e844b86e9

View File

@ -9,7 +9,7 @@ const tooltip = document.getElementById("map-tooltip");
const tooltipCache = {}; const tooltipCache = {};
/* ================================ /* ================================
Gaststätte Popup Gaststätte Popup soll hier aufgehen
================================ */ ================================ */
const gaststaettePopup = document.getElementById("gaststaette-popup"); const gaststaettePopup = document.getElementById("gaststaette-popup");
@ -17,8 +17,12 @@ const qmOverlay = document.getElementById("qm-overlay");
document.querySelectorAll(".gaststaette-tab").forEach((tab) => { document.querySelectorAll(".gaststaette-tab").forEach((tab) => {
tab.addEventListener("click", () => { tab.addEventListener("click", () => {
document.querySelectorAll(".gaststaette-tab").forEach((t) => t.classList.remove("active")); document
document.querySelectorAll(".gaststaette-tab-content").forEach((c) => c.classList.remove("active")); .querySelectorAll(".gaststaette-tab")
.forEach((t) => t.classList.remove("active"));
document
.querySelectorAll(".gaststaette-tab-content")
.forEach((c) => c.classList.remove("active"));
tab.classList.add("active"); tab.classList.add("active");
document.getElementById(tab.dataset.tab).classList.add("active"); document.getElementById(tab.dataset.tab).classList.add("active");
}); });
@ -277,7 +281,8 @@ document.querySelectorAll(".building").forEach((building) => {
building.addEventListener("mouseenter", async (e) => { building.addEventListener("mouseenter", async (e) => {
try { try {
// data-id bevorzugen, sonst ID aus href extrahieren (z.B. "/building/5" → "5") // 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 (!id) return;
if (!tooltipCache[id]) { if (!tooltipCache[id]) {