Escape key closes detail panel and range circle

This commit is contained in:
Graham McIntire 2026-03-31 18:01:41 -05:00
parent 8c45125e7c
commit d9b309ac6d
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

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