Skip to content

Commit

Permalink
Rollup merge of #76052 - aszenz:GH-66816_removes_disable_attribute_be…
Browse files Browse the repository at this point in the history
…fore_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
  • Loading branch information
matklad committed Aug 31, 2020
2 parents 6ce3243 + eb2bb99 commit 300d7f6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -2781,10 +2788,7 @@ function defocusSearchBar() {
elem.value = savedCrate;
}
}

if (search_input) {
search_input.removeAttribute('disabled');
}
enableSearchInput();
};

function buildHelperPopup() {
Expand Down

0 comments on commit 300d7f6

Please sign in to comment.