mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 04:14:28 +00:00
Rollup merge of #105016 - GuillaumeGomez:load-sentence-rustdoc, r=notriddle
Add sentence when rustdoc search is running This is a small improvement, mostly relevant on big search indexes. As soon as the search starts, it'll display:  cc ``@jsha`` r? ``@notriddle``
This commit is contained in:
commit
1ad234c3fc
@ -302,13 +302,15 @@ function loadCss(cssUrl) {
|
|||||||
|
|
||||||
const params = searchState.getQueryStringParams();
|
const params = searchState.getQueryStringParams();
|
||||||
if (params.search !== undefined) {
|
if (params.search !== undefined) {
|
||||||
const search = searchState.outputElement();
|
searchState.setLoadingSearch();
|
||||||
search.innerHTML = "<h3 class=\"search-loading\">" +
|
|
||||||
searchState.loadingText + "</h3>";
|
|
||||||
searchState.showResults(search);
|
|
||||||
loadSearch();
|
loadSearch();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
setLoadingSearch: () => {
|
||||||
|
const search = searchState.outputElement();
|
||||||
|
search.innerHTML = "<h3 class=\"search-loading\">" + searchState.loadingText + "</h3>";
|
||||||
|
searchState.showResults(search);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getPageId() {
|
function getPageId() {
|
||||||
|
@ -1766,13 +1766,13 @@ function initSearch(rawSearchIndex) {
|
|||||||
* @param {boolean} [forced]
|
* @param {boolean} [forced]
|
||||||
*/
|
*/
|
||||||
function search(e, forced) {
|
function search(e, forced) {
|
||||||
const params = searchState.getQueryStringParams();
|
|
||||||
const query = parseQuery(searchState.input.value.trim());
|
|
||||||
|
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const query = parseQuery(searchState.input.value.trim());
|
||||||
|
let filterCrates = getFilterCrates();
|
||||||
|
|
||||||
if (!forced && query.userQuery === currentResults) {
|
if (!forced && query.userQuery === currentResults) {
|
||||||
if (query.userQuery.length > 0) {
|
if (query.userQuery.length > 0) {
|
||||||
putBackSearch();
|
putBackSearch();
|
||||||
@ -1780,7 +1780,9 @@ function initSearch(rawSearchIndex) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let filterCrates = getFilterCrates();
|
searchState.setLoadingSearch();
|
||||||
|
|
||||||
|
const params = searchState.getQueryStringParams();
|
||||||
|
|
||||||
// In case we have no information about the saved crate and there is a URL query parameter,
|
// In case we have no information about the saved crate and there is a URL query parameter,
|
||||||
// we override it with the URL query parameter.
|
// we override it with the URL query parameter.
|
||||||
|
Loading…
Reference in New Issue
Block a user