mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 07:18:38 +00:00
generated docs: avoid clobbering browser shortcut keys
This commit is contained in:
parent
000a1df4a3
commit
510b6443ba
@ -1074,6 +1074,8 @@
|
||||
function onSearchKeyDown(ev) {
|
||||
switch (ev.which) {
|
||||
case 13:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
|
||||
// detect if this search changes anything
|
||||
var terms1 = getSearchTerms();
|
||||
startSearch();
|
||||
@ -1087,6 +1089,8 @@
|
||||
ev.stopPropagation();
|
||||
return;
|
||||
case 27:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
|
||||
domSearch.value = "";
|
||||
domSearch.blur();
|
||||
curSearchIndex = -1;
|
||||
@ -1095,16 +1099,22 @@
|
||||
startSearch();
|
||||
return;
|
||||
case 38:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
|
||||
moveSearchCursor(-1);
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
return;
|
||||
case 40:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
|
||||
moveSearchCursor(1);
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
return;
|
||||
default:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
|
||||
curSearchIndex = -1;
|
||||
ev.stopPropagation();
|
||||
startAsyncSearch();
|
||||
@ -1134,6 +1144,7 @@
|
||||
function onWindowKeyDown(ev) {
|
||||
switch (ev.which) {
|
||||
case 27:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
if (!domHelpModal.classList.contains("hidden")) {
|
||||
domHelpModal.classList.add("hidden");
|
||||
ev.preventDefault();
|
||||
@ -1141,6 +1152,7 @@
|
||||
}
|
||||
break;
|
||||
case 83:
|
||||
if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
domSearch.focus();
|
||||
domSearch.select();
|
||||
ev.preventDefault();
|
||||
@ -1148,6 +1160,7 @@
|
||||
startAsyncSearch();
|
||||
break;
|
||||
case 191:
|
||||
if (!ev.shiftKey || ev.ctrlKey || ev.altKey) return;
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
showHelpModal();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user