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:
Steve Klabnik 2015-11-05 22:28:48 +01:00
commit 09a1e5853e
1 changed files with 4 additions and 0 deletions

View File

@ -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")) {