authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2023-05-02 04:41:25+02:00
committergravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2023-05-02 04:41:25+02:00
log6f1336a50c6c2d9498bb9b3fb291cb305688c1b9
treeeb253b47f523021e417f2132b2ef58a0d2599503
parent28923474401051a9aa0bddd60904b9be64943dba

autodoc: make the help modal toggleable

Now you can simply press "?" again to toggle the help modal instead of requiring Esc. Both Esc and "?" work.

2 files changed, 10 insertions(+), 5 deletions(-)

lib/docs/index.html+1-1
......@@ -875,7 +875,7 @@
875875 <div class="help-modal">
876876 <div class="modal">
877877 <h1>Keyboard Shortcuts</h1>
878 <dl><dt><kbd>?</kbd></dt><dd>Show this help modal</dd></dl>
878 <dl><dt><kbd>?</kbd></dt><dd>Toggle this help modal</dd></dl>
879879 <dl><dt><kbd>s</kbd></dt><dd>Focus the search field</dd></dl>
880880 <div style="margin-left: 1em">
881881 <dl><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd></dl>
lib/docs/main.js+9-4
......@@ -4044,9 +4044,14 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) {
40444044 }
40454045 break;
40464046 case "?":
4047 ev.preventDefault();
4048 ev.stopPropagation();
4049 showHelpModal();
4047 // toggle the help modal
4048 if (!domHelpModal.classList.contains("hidden")) {
4049 onEscape(ev);
4050 } else {
4051 ev.preventDefault();
4052 ev.stopPropagation();
4053 showHelpModal();
4054 }
40504055 break;
40514056 }
40524057 }
......@@ -4850,4 +4855,4 @@ function RadixTree() {
48504855
48514856// BUT!
48524857
4853// We want to be able to search "Hash", for example!
\ No newline at end of file
4858// We want to be able to search "Hash", for example!