From 4ef567ba41b7b9f83eb26d52128125b6837beb2f Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Sat, 6 Aug 2022 15:01:55 +0200 Subject: [PATCH 01/11] feat: make help modal disappear if you click outside it --- lib/docs/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/docs/main.js b/lib/docs/main.js index 41a03322d9af..2bb796f49b4b 100644 --- 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(); From 6354851909749d9741d520ead2d1f9e517df3548 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Sat, 6 Aug 2022 15:05:58 +0200 Subject: [PATCH 02/11] fix: "dialog" -> "modal" "Dialog" is the incorrect term here because a dialog is a separate window that still lets you use the app but a modal is a window where you can't continue using the app until you close it. --- lib/docs/index.html | 11 +++++------ lib/docs/main.js | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/docs/index.html b/lib/docs/index.html index dbcb54288afd..5d6f3818639a 100644 --- a/lib/docs/index.html +++ b/lib/docs/index.html @@ -294,7 +294,6 @@ padding: 1px 1em; } - /* help dialog */ .help-modal { display: flex; width: 100%; @@ -308,7 +307,7 @@ backdrop-filter: blur(0.3em); } - .help-modal > .dialog { + .help-modal > .modal { max-width: 97vw; max-height: 97vh; overflow: auto; @@ -707,12 +706,12 @@

Tests

-