Skip to content

Commit 4ef567b

Browse files
author
r00ster91
committed
feat: make help modal disappear if you click outside it
1 parent 5c98266 commit 4ef567b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/docs/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ var zigAnalysis;
132132
location.hash = "#root";
133133
}
134134

135+
// make the modal disappear if you click outside it
136+
domHelpModal.addEventListener("click", ev => {
137+
if (ev.target.className == "help-modal")
138+
domHelpModal.classList.add("hidden");
139+
})
140+
135141
window.addEventListener("hashchange", onHashChange, false);
136142
window.addEventListener("keydown", onWindowKeyDown, false);
137143
onHashChange();

0 commit comments

Comments
 (0)