diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-03-05 23:37:33 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-03-09 17:45:44 +0100 |
| commit | 9e0ccc5a479644bf35ffe04717d6e100fde74fcc (patch) | |
| tree | e8233aeb9b6e333c96bedbcfa630bffe32f3d7c1 /src | |
| parent | 6235ef04222d33aa9a48876098ba335f867856da (diff) | |
Fix escape not working when searchbar selected
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/static/main.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 3f74ffbbe0b..f1c9c58a4eb 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -240,12 +240,15 @@ } function handleShortcut(ev) { - if (document.activeElement.tagName === "INPUT") + if (document.activeElement.tagName === "INPUT" && + hasClass(document.getElementById('main'), "hidden")) { return; + } // Don't interfere with browser shortcuts - if (ev.ctrlKey || ev.altKey || ev.metaKey) + if (ev.ctrlKey || ev.altKey || ev.metaKey) { return; + } var help = document.getElementById("help"); switch (getVirtualKey(ev)) { @@ -1800,7 +1803,7 @@ if (!next) { return; } - if (checkIfThereAreMethods(next.childNodes) && + if ((checkIfThereAreMethods(next.childNodes) || hasClass(e, 'method')) && (hasClass(next, 'docblock') || hasClass(e, 'impl') || (hasClass(next, 'stability') && |
