From d9b309ac6d78c2337f4cba6959b873f62d8895ae Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 31 Mar 2026 18:01:41 -0500 Subject: [PATCH] Escape key closes detail panel and range circle --- assets/js/propagation_map_hook.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/assets/js/propagation_map_hook.js b/assets/js/propagation_map_hook.js index ebebf9eb..2b9bec4c 100644 --- a/assets/js/propagation_map_hook.js +++ b/assets/js/propagation_map_hook.js @@ -533,6 +533,19 @@ export const PropagationMap = { L.DomEvent.disableScrollPropagation(this.timelineEl) } + // Escape key closes detail panel and range circles + document.addEventListener("keydown", (e) => { + if (e.key === "Escape") { + if (this.detailPanel) { + this.detailPanel.style.display = "none" + this.detailPanel.innerHTML = "" + } + this.rangeCircles.clearLayers() + this.clickedLatLng = null + this.lastDetail = null + } + }) + this.el.addEventListener("show-loading", () => topbar.show(300)) this.sendBounds()