feat: make help modal disappear if you click outside it

This commit is contained in:
r00ster91 2022-08-06 15:01:55 +02:00
parent 5c9826630d
commit 4ef567ba41

View File

@ -132,6 +132,12 @@ var zigAnalysis;
location.hash = "#root";
}
// make the modal disappear if you click outside it
domHelpModal.addEventListener("click", ev => {
if (ev.target.className == "help-modal")
domHelpModal.classList.add("hidden");
})
window.addEventListener("hashchange", onHashChange, false);
window.addEventListener("keydown", onWindowKeyDown, false);
onHashChange();