Move focusSearchBar and defocusSearchBar functions to the top of the file with other functions

This commit is contained in:
Guillaume Gomez 2020-05-17 14:06:21 +02:00
parent 9eedd138ee
commit 0fa4762a80

View File

@ -47,6 +47,17 @@ function getSearchElement() {
return document.getElementById("search");
}
// Sets the focus on the search bar at the top of the page
function focusSearchBar() {
getSearchInput().focus();
}
// Removes the focus from the search bar
function defocusSearchBar() {
getSearchInput().blur();
}
(function() {
"use strict";
@ -2778,16 +2789,6 @@ function getSearchElement() {
buildHelperPopup();
}());
// Sets the focus on the search bar at the top of the page
function focusSearchBar() {
getSearchInput().focus();
}
// Removes the focus from the search bar
function defocusSearchBar() {
getSearchInput().blur();
}
// This is required in firefox. Explanations: when going back in the history, firefox doesn't re-run
// the JS, therefore preventing rustdoc from setting a few things required to be able to reload the
// previous search results (if you navigated to a search result with the keyboard, pressed enter on