about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-08-31 12:51:46 +0200
committerGitHub <noreply@github.com>2020-08-31 12:51:46 +0200
commit300d7f661a325a51e58b835b435bc8bb904f4b3d (patch)
tree6e647952de99a0c5c181d4dca79c5df13ea9017e /src
parent6ce32439952401b4c6dd613df9b35fa058591e32 (diff)
parenteb2bb9902141e228549c30f39d99f11e0cff4ee4 (diff)
downloadrust-300d7f661a325a51e58b835b435bc8bb904f4b3d.tar.gz
rust-300d7f661a325a51e58b835b435bc8bb904f4b3d.zip
Rollup merge of #76052 - aszenz:GH-66816_removes_disable_attribute_before_return, r=GuillaumeGomez
GH-66816:  Remove disable attr before return

Passing --disable-per-crate-search removes the create search inputs so moved code around so that the search input is enabled
first before the function returns.

Fixes #66816
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index a1eef5c1202..1b3eb2011af 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2740,10 +2740,17 @@ function defocusSearchBar() {
         });
     }
 
+    function enableSearchInput() {
+        if (search_input) {
+            search_input.removeAttribute('disabled');
+        }
+    }
+
     window.addSearchOptions = function(crates) {
         var elem = document.getElementById("crate-search");
 
         if (!elem) {
+            enableSearchInput();
             return;
         }
         var crates_text = [];
@@ -2781,10 +2788,7 @@ function defocusSearchBar() {
                 elem.value = savedCrate;
             }
         }
-
-        if (search_input) {
-            search_input.removeAttribute('disabled');
-        }
+        enableSearchInput();
     };
 
     function buildHelperPopup() {