mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 14:59:14 +00:00
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.
This commit is contained in:
parent
2892347440
commit
6f1336a50c
@ -875,7 +875,7 @@
|
||||
<div class="help-modal">
|
||||
<div class="modal">
|
||||
<h1>Keyboard Shortcuts</h1>
|
||||
<dl><dt><kbd>?</kbd></dt><dd>Show this help modal</dd></dl>
|
||||
<dl><dt><kbd>?</kbd></dt><dd>Toggle this help modal</dd></dl>
|
||||
<dl><dt><kbd>s</kbd></dt><dd>Focus the search field</dd></dl>
|
||||
<div style="margin-left: 1em">
|
||||
<dl><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd></dl>
|
||||
|
||||
@ -4044,9 +4044,14 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) {
|
||||
}
|
||||
break;
|
||||
case "?":
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
showHelpModal();
|
||||
// toggle the help modal
|
||||
if (!domHelpModal.classList.contains("hidden")) {
|
||||
onEscape(ev);
|
||||
} else {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
showHelpModal();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4850,4 +4855,4 @@ function RadixTree() {
|
||||
|
||||
// BUT!
|
||||
|
||||
// We want to be able to search "Hash", for example!
|
||||
// We want to be able to search "Hash", for example!
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user