commit 4ef567ba41b7b9f83eb26d52128125b6837beb2f (tree)
parent 5c9826630dfb8a2f59663a569bb8e452359c9524
Author: r00ster91 <r00ster91@proton.me>
Date: Sat, 6 Aug 2022 15:01:55 +0200
feat: make help modal disappear if you click outside it
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/docs/main.js b/lib/docs/main.js
@@ -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();