Defocus search bar in rustdoc pages

Escape now removes focus from the search bar
This commit is contained in:
Johannes Boczek
2018-01-02 19:47:44 +01:00
parent 687d3d15ba
commit 0772b6faed

View File

@@ -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();
}