mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 08:33:06 +00:00
fix: scroll page to very top when S is pressed
Credits go to @rudedogg
This commit is contained in:
parent
af20dfae60
commit
78bb29d1dc
@ -612,7 +612,7 @@
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="flex-right">
|
||||
<div id="docs" class="flex-right">
|
||||
<div class="wrap">
|
||||
<section class="docs">
|
||||
<div style="position: relative">
|
||||
|
@ -41,7 +41,7 @@ var zigAnalysis;
|
||||
const domSearch = document.getElementById("search");
|
||||
const domSectSearchResults = document.getElementById("sectSearchResults");
|
||||
const domSectSearchAllResultsLink = document.getElementById("sectSearchAllResultsLink");
|
||||
|
||||
const domDocs = document.getElementById("docs");
|
||||
const domListSearchResults = document.getElementById("listSearchResults");
|
||||
const domSectSearchNoResults = document.getElementById("sectSearchNoResults");
|
||||
const domSectInfo = document.getElementById("sectInfo");
|
||||
@ -3262,9 +3262,9 @@ var zigAnalysis;
|
||||
break;
|
||||
case "s":
|
||||
if (domHelpModal.classList.contains("hidden")) {
|
||||
// TODO: scroll the page to the very top
|
||||
domSearch.focus();
|
||||
domSearch.select();
|
||||
domDocs.scrollTo(0, 0);
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
startAsyncSearch();
|
||||
|
Loading…
Reference in New Issue
Block a user