From aa5c48b35661014c09ae0a44aa6f81d826077940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?= Date: Tue, 3 Sep 2024 19:07:27 +0200 Subject: [PATCH] added icon-dot-circled to locate burg - icon dot-circled - function zoomIntoBurg() --- index.html | 1 + modules/ui/burg-editor.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/index.html b/index.html index 8eb8d2c2..ad63aba3 100644 --- a/index.html +++ b/index.html @@ -3513,6 +3513,7 @@ + diff --git a/modules/ui/burg-editor.js b/modules/ui/burg-editor.js index 94145e13..2275f4a1 100644 --- a/modules/ui/burg-editor.js +++ b/modules/ui/burg-editor.js @@ -47,6 +47,7 @@ function editBurg(id) { byId("burgEmblem").addEventListener("click", openEmblemEdit); byId("burgTogglePreview").addEventListener("click", toggleBurgPreview); byId("burgEditEmblem").addEventListener("click", openEmblemEdit); + byId("burgLocate").addEventListener("click", zoomIntoBurg); byId("burgRelocate").addEventListener("click", toggleRelocateBurg); byId("burglLegend").addEventListener("click", editBurgLegend); byId("burgLock").addEventListener("click", toggleBurgLockButton); @@ -397,6 +398,14 @@ function editBurg(id) { byId("burgTogglePreview").className = options.showBurgPreview ? "icon-map" : "icon-map-o"; } + function zoomIntoBurg() { + const id = elSelected.attr("data-id"); + const label = document.querySelector("#burgLabels [data-id='" + id + "']"); + const x = +label.getAttribute("x"); + const y = +label.getAttribute("y"); + zoomTo(x, y, 8, 2000); + } + function toggleRelocateBurg() { const toggler = byId("toggleCells"); byId("burgRelocate").classList.toggle("pressed");