about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJohannes Boczek <johannes.boczek@web.de>2018-01-02 19:47:44 +0100
committerJohannes Boczek <johannes.boczek@web.de>2018-01-02 19:47:44 +0100
commit0772b6faed23d736f5e63738dcd8839193cf0660 (patch)
tree9dd1d57488b94aa57d3bd7a297c64d054693a3c5 /src
parent687d3d15ba726dbb1ac6b85223ebe0e98c6820cc (diff)
downloadrust-0772b6faed23d736f5e63738dcd8839193cf0660.tar.gz
rust-0772b6faed23d736f5e63738dcd8839193cf0660.zip
Defocus search bar in rustdoc pages
Escape now removes focus from the search bar
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 559f8494fc3..5e4a02994b1 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -258,6 +258,7 @@
                 addClass(search, "hidden");
                 removeClass(document.getElementById("main"), "hidden");
             }
+			defocusSearchBar();
             break;
 
         case "s":
@@ -1884,3 +1885,8 @@
 function focusSearchBar() {
     document.getElementsByClassName('search-input')[0].focus();
 }
+
+// Removes the focus from the search bar
+function defocusSearchBar() {
+    document.getElementsByClassName('search-input')[0].blur();
+}
\ No newline at end of file