Skip to content

Commit

Permalink
Merge pull request #71 from GabsEdits/feat/leave-popup-on-esc
Browse files Browse the repository at this point in the history
feat(funding): exit popup on esc
  • Loading branch information
mirkobrombin authored Dec 29, 2024
2 parents 250834c + 6e0860f commit 7f27893
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pages/funding.astro
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,15 @@ const legendIcons = [
?.addEventListener("click", () => {
document.getElementById("infoModal")?.classList.add("hidden");
});

document.addEventListener("keydown", (event) => {
if (event.key === "Escape") {
document.getElementById("donationModal")?.classList.add("hidden");
document.getElementById("cryptoModal")?.classList.add("hidden");
document.getElementById("infoModal")?.classList.add("hidden");
}
});

const filterButtons = document.querySelectorAll(".filter-button");
const searchInput = document.getElementById(
"searchInput"
Expand Down

0 comments on commit 7f27893

Please sign in to comment.