Skip to content

Commit 1403170

Browse files
authored
Rollup merge of rust-lang#76052 - aszenz:GH-66816_removes_disable_attribute_before_return, r=GuillaumeGomez
rust-langGH-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 rust-lang#66816
2 parents 275d0c5 + eb2bb99 commit 1403170

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/librustdoc/html/static/main.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -2740,10 +2740,17 @@ function defocusSearchBar() {
27402740
});
27412741
}
27422742

2743+
function enableSearchInput() {
2744+
if (search_input) {
2745+
search_input.removeAttribute('disabled');
2746+
}
2747+
}
2748+
27432749
window.addSearchOptions = function(crates) {
27442750
var elem = document.getElementById("crate-search");
27452751

27462752
if (!elem) {
2753+
enableSearchInput();
27472754
return;
27482755
}
27492756
var crates_text = [];
@@ -2781,10 +2788,7 @@ function defocusSearchBar() {
27812788
elem.value = savedCrate;
27822789
}
27832790
}
2784-
2785-
if (search_input) {
2786-
search_input.removeAttribute('disabled');
2787-
}
2791+
enableSearchInput();
27882792
};
27892793

27902794
function buildHelperPopup() {

0 commit comments

Comments
 (0)