Auto merge of #46221 - GuillaumeGomez:doc-script-load-speedup, r=nrc
Speedup search loading when search url is received Fixes #45971. r? @nrc cc @rust-lang/docs
This commit is contained in:
commit
bb1bd88ec3
1 changed files with 9 additions and 2 deletions
|
@ -119,8 +119,7 @@
|
||||||
map(function(s) {
|
map(function(s) {
|
||||||
var pair = s.split("=");
|
var pair = s.split("=");
|
||||||
params[decodeURIComponent(pair[0])] =
|
params[decodeURIComponent(pair[0])] =
|
||||||
typeof pair[1] === "undefined" ?
|
typeof pair[1] === "undefined" ? null : decodeURIComponent(pair[1]);
|
||||||
null : decodeURIComponent(pair[1]);
|
|
||||||
});
|
});
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
@ -1822,6 +1821,14 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var params = getQueryStringParams();
|
||||||
|
if (params && params.search) {
|
||||||
|
addClass(document.getElementById("main"), "hidden");
|
||||||
|
var search = document.getElementById("search");
|
||||||
|
removeClass(search, "hidden");
|
||||||
|
search.innerHTML = '<h3 style="text-align: center;">Loading search results...</h3>';
|
||||||
|
}
|
||||||
}());
|
}());
|
||||||
|
|
||||||
// Sets the focus on the search bar at the top of the page
|
// Sets the focus on the search bar at the top of the page
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue