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 @@...@@ -875,7 +875,7 @@
875 <div class="help-modal">875 <div class="help-modal">
876 <div class="modal">876 <div class="modal">
877 <h1>Keyboard Shortcuts</h1>877 <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>
879 <dl><dt><kbd>s</kbd></dt><dd>Focus the search field</dd></dl>879 <dl><dt><kbd>s</kbd></dt><dd>Focus the search field</dd></dl>
880 <div style="margin-left: 1em">880 <div style="margin-left: 1em">
881 <dl><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd></dl>881 <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) {...@@ -4044,9 +4044,14 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) {
4044 }4044 }
4045 break;4045 break;
4046 case "?":4046 case "?":
4047 ev.preventDefault();4047 // toggle the help modal
4048 ev.stopPropagation();4048 if (!domHelpModal.classList.contains("hidden")) {
4049 showHelpModal();4049 onEscape(ev);
4050 } else {
4051 ev.preventDefault();
4052 ev.stopPropagation();
4053 showHelpModal();
4054 }
4050 break;4055 break;
4051 }4056 }
4052 }4057 }
...@@ -4850,4 +4855,4 @@ function RadixTree() {...@@ -4850,4 +4855,4 @@ function RadixTree() {
48504855
4851// BUT!4856// 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!