Rollup merge of #29609 - ivan:rustdoc-ctrl-s, r=steveklabnik
Rustdoc pages with a search box inadvertently override `ctrl-s` in addition to the intended `s` and `S` keys. You can test this in at least Firefox and Chrome (tested: Windows): press `ctrl-s` on http://doc.rust-lang.org/std/. The search box is focused when instead the browser's save feature should be activated. This PR fixes `ctrl-s` and possibly other browser shortcuts.
This commit is contained in:
commit
09a1e5853e
|
@ -101,6 +101,10 @@
|
|||
if (document.activeElement.tagName == "INPUT")
|
||||
return;
|
||||
|
||||
// Don't interfere with browser shortcuts
|
||||
if (ev.ctrlKey || ev.altKey || ev.metaKey)
|
||||
return;
|
||||
|
||||
switch (getVirtualKey(ev)) {
|
||||
case "Escape":
|
||||
if (!$("#help").hasClass("hidden")) {
|
||||
|
|
Loading…
Reference in New Issue