Rollup merge of #76022 - GuillaumeGomez:cleanup-rustdoc-front, r=jyn514
Clean up rustdoc front-end source code r? @jyn514
This commit is contained in:
commit
b1f983a582
1 changed files with 9 additions and 8 deletions
|
@ -92,6 +92,7 @@ function defocusSearchBar() {
|
||||||
var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") === "true";
|
var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") === "true";
|
||||||
var search_input = getSearchInput();
|
var search_input = getSearchInput();
|
||||||
var searchTimeout = null;
|
var searchTimeout = null;
|
||||||
|
var toggleAllDocsId = "toggle-all-docs";
|
||||||
|
|
||||||
// On the search screen, so you remain on the last tab you opened.
|
// On the search screen, so you remain on the last tab you opened.
|
||||||
//
|
//
|
||||||
|
@ -1397,8 +1398,8 @@ function defocusSearchBar() {
|
||||||
// "current" is used to know which tab we're looking into.
|
// "current" is used to know which tab we're looking into.
|
||||||
var current = 0;
|
var current = 0;
|
||||||
onEachLazy(document.getElementById("results").childNodes, function(e) {
|
onEachLazy(document.getElementById("results").childNodes, function(e) {
|
||||||
onEachLazy(e.getElementsByClassName("highlighted"), function(e) {
|
onEachLazy(e.getElementsByClassName("highlighted"), function(h_e) {
|
||||||
actives[current].push(e);
|
actives[current].push(h_e);
|
||||||
});
|
});
|
||||||
current += 1;
|
current += 1;
|
||||||
});
|
});
|
||||||
|
@ -2121,7 +2122,7 @@ function defocusSearchBar() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAllDocs(pageId, fromAutoCollapse) {
|
function toggleAllDocs(pageId, fromAutoCollapse) {
|
||||||
var innerToggle = document.getElementById("toggle-all-docs");
|
var innerToggle = document.getElementById(toggleAllDocsId);
|
||||||
if (!innerToggle) {
|
if (!innerToggle) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2314,11 +2315,6 @@ function defocusSearchBar() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var toggles = document.getElementById("toggle-all-docs");
|
|
||||||
if (toggles) {
|
|
||||||
toggles.onclick = toggleAllDocs;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertAfter(newNode, referenceNode) {
|
function insertAfter(newNode, referenceNode) {
|
||||||
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
||||||
}
|
}
|
||||||
|
@ -2368,6 +2364,11 @@ function defocusSearchBar() {
|
||||||
}
|
}
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
var toggles = document.getElementById(toggleAllDocsId);
|
||||||
|
if (toggles) {
|
||||||
|
toggles.onclick = toggleAllDocs;
|
||||||
|
}
|
||||||
|
|
||||||
var toggle = createSimpleToggle(false);
|
var toggle = createSimpleToggle(false);
|
||||||
var hideMethodDocs = getCurrentValue("rustdoc-auto-hide-method-docs") === "true";
|
var hideMethodDocs = getCurrentValue("rustdoc-auto-hide-method-docs") === "true";
|
||||||
var hideImplementors = getCurrentValue("rustdoc-auto-collapse-implementors") !== "false";
|
var hideImplementors = getCurrentValue("rustdoc-auto-collapse-implementors") !== "false";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue