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()