mirror of
https://github.com/ziglang/zig.git
synced 2025-12-29 17:43:17 +00:00
Merge pull request #15512 from cryptocode/autodoc-searchkey
autodoc: Add / as an alternative search key
This commit is contained in:
commit
329a585fbe
@ -758,7 +758,7 @@
|
||||
<div class="wrap">
|
||||
<section class="docs" style="padding-top: 1.5rem; padding-bottom:0;">
|
||||
<div style="position: relative">
|
||||
<span id="searchPlaceholder"><kbd>s</kbd> to search, <kbd>?</kbd> for more options</span>
|
||||
<span id="searchPlaceholder"><kbd>/</kbd> or <kbd>s</kbd> to search, <kbd>?</kbd> for more options</span>
|
||||
<input type="search" class="search" id="search" autocomplete="off" spellcheck="false" disabled>
|
||||
</div>
|
||||
</section>
|
||||
@ -876,7 +876,7 @@
|
||||
<div class="modal">
|
||||
<h1>Keyboard Shortcuts</h1>
|
||||
<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>
|
||||
<dl><dt><kbd>s</kbd> or <kbd>/</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>
|
||||
<dl><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd></dl>
|
||||
|
||||
@ -4106,6 +4106,7 @@ function addDeclToSearchResults(decl, declIndex, modNames, item, list, stack) {
|
||||
case "Esc":
|
||||
onEscape(ev);
|
||||
break;
|
||||
case "/":
|
||||
case "s":
|
||||
if (domHelpModal.classList.contains("hidden")) {
|
||||
if (ev.target == domSearch) break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user