diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-05-17 14:06:21 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-05-26 11:18:10 +0200 |
| commit | 0fa4762a807a8e637aeaa805bc705c52a1c70d13 (patch) | |
| tree | 8ba195fea1c6abdd01d1edc53602084ec0525e85 | |
| parent | 9eedd138ee22147111a885d6948fb050d9849bf4 (diff) | |
| download | rust-0fa4762a807a8e637aeaa805bc705c52a1c70d13.tar.gz rust-0fa4762a807a8e637aeaa805bc705c52a1c70d13.zip | |
Move focusSearchBar and defocusSearchBar functions to the top of the file with other functions
| -rw-r--r-- | src/librustdoc/html/static/main.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 9869c50fbb0..94d74bf793e 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -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 |
