authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-09 18:28:50-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-09 18:28:50-04:00
log510b6443ba1eb36bb2e6f7e992044fd63ee83985
treed5f211f62f4442f87917fe691edf1cac4f7671ae
parent000a1df4a31eb04012d8c1f0bd3bff7815e19a03
signaturelock-open Commit is signed but in an unrecognized format.

generated docs: avoid clobbering browser shortcut keys


1 files changed, 13 insertions(+), 0 deletions(-)

lib/std/special/docs/main.js+13
......@@ -1074,6 +1074,8 @@
10741074 function onSearchKeyDown(ev) {
10751075 switch (ev.which) {
10761076 case 13:
1077 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
1078
10771079 // detect if this search changes anything
10781080 var terms1 = getSearchTerms();
10791081 startSearch();
......@@ -1087,6 +1089,8 @@
10871089 ev.stopPropagation();
10881090 return;
10891091 case 27:
1092 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
1093
10901094 domSearch.value = "";
10911095 domSearch.blur();
10921096 curSearchIndex = -1;
......@@ -1095,16 +1099,22 @@
10951099 startSearch();
10961100 return;
10971101 case 38:
1102 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
1103
10981104 moveSearchCursor(-1);
10991105 ev.preventDefault();
11001106 ev.stopPropagation();
11011107 return;
11021108 case 40:
1109 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
1110
11031111 moveSearchCursor(1);
11041112 ev.preventDefault();
11051113 ev.stopPropagation();
11061114 return;
11071115 default:
1116 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
1117
11081118 curSearchIndex = -1;
11091119 ev.stopPropagation();
11101120 startAsyncSearch();
......@@ -1134,6 +1144,7 @@
11341144 function onWindowKeyDown(ev) {
11351145 switch (ev.which) {
11361146 case 27:
1147 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
11371148 if (!domHelpModal.classList.contains("hidden")) {
11381149 domHelpModal.classList.add("hidden");
11391150 ev.preventDefault();
......@@ -1141,6 +1152,7 @@
11411152 }
11421153 break;
11431154 case 83:
1155 if (ev.shiftKey || ev.ctrlKey || ev.altKey) return;
11441156 domSearch.focus();
11451157 domSearch.select();
11461158 ev.preventDefault();
......@@ -1148,6 +1160,7 @@
11481160 startAsyncSearch();
11491161 break;
11501162 case 191:
1163 if (!ev.shiftKey || ev.ctrlKey || ev.altKey) return;
11511164 ev.preventDefault();
11521165 ev.stopPropagation();
11531166 showHelpModal();