rustdoc: fixes #64305: disable search field instead of hidding it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
9b0214d9c5
commit
5cbd406a14
3 changed files with 7 additions and 6 deletions
|
@ -86,10 +86,11 @@ pub fn render<T: Print, S: Print>(
|
||||||
</div>\
|
</div>\
|
||||||
<script src=\"{static_root_path}theme{suffix}.js\"></script>\
|
<script src=\"{static_root_path}theme{suffix}.js\"></script>\
|
||||||
<nav class=\"sub\">\
|
<nav class=\"sub\">\
|
||||||
<form class=\"search-form js-only\">\
|
<form class=\"search-form\">\
|
||||||
<div class=\"search-container\">\
|
<div class=\"search-container\">\
|
||||||
<div>{filter_crates}\
|
<div>{filter_crates}\
|
||||||
<input class=\"search-input\" name=\"search\" \
|
<input class=\"search-input\" name=\"search\" \
|
||||||
|
disabled \
|
||||||
autocomplete=\"off\" \
|
autocomplete=\"off\" \
|
||||||
spellcheck=\"false\" \
|
spellcheck=\"false\" \
|
||||||
placeholder=\"Click or press ‘S’ to search, ‘?’ for more options…\" \
|
placeholder=\"Click or press ‘S’ to search, ‘?’ for more options…\" \
|
||||||
|
|
|
@ -142,10 +142,6 @@ function getSearchElement() {
|
||||||
var TY_PRIMITIVE = itemTypes.indexOf("primitive");
|
var TY_PRIMITIVE = itemTypes.indexOf("primitive");
|
||||||
var TY_KEYWORD = itemTypes.indexOf("keyword");
|
var TY_KEYWORD = itemTypes.indexOf("keyword");
|
||||||
|
|
||||||
onEachLazy(document.getElementsByClassName("js-only"), function(e) {
|
|
||||||
removeClass(e, "js-only");
|
|
||||||
});
|
|
||||||
|
|
||||||
function getQueryStringParams() {
|
function getQueryStringParams() {
|
||||||
var params = {};
|
var params = {};
|
||||||
window.location.search.substring(1).split("&").
|
window.location.search.substring(1).split("&").
|
||||||
|
@ -2626,6 +2622,10 @@ function getSearchElement() {
|
||||||
option.innerText = crates_text[i];
|
option.innerText = crates_text[i];
|
||||||
elem.appendChild(option);
|
elem.appendChild(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (search_input) {
|
||||||
|
search_input.removeAttribute('disabled');
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addSearchOptions = addSearchOptions;
|
window.addSearchOptions = addSearchOptions;
|
||||||
|
|
|
@ -197,7 +197,7 @@ nav.sub {
|
||||||
|
|
||||||
/* Everything else */
|
/* Everything else */
|
||||||
|
|
||||||
.js-only, .hidden {
|
.hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue