]> git.lizzy.rs Git - rust.git/commitdiff
Defocus search bar in rustdoc pages
authorJohannes Boczek <johannes.boczek@web.de>
Tue, 2 Jan 2018 18:47:44 +0000 (19:47 +0100)
committerJohannes Boczek <johannes.boczek@web.de>
Tue, 2 Jan 2018 18:47:44 +0000 (19:47 +0100)
Escape now removes focus from the search bar

src/librustdoc/html/static/main.js

index 559f8494fc3c0a4d863022f1c14698fbc15e8876..5e4a02994b116889738c16d7f36678ab526b339d 100644 (file)
                 addClass(search, "hidden");
                 removeClass(document.getElementById("main"), "hidden");
             }
+                       defocusSearchBar();
             break;
 
         case "s":
 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