Rollup merge of #58146 - GuillaumeGomez:dont-collapse-everything, r=QuietMisdreavus
Prevent automatic collapse of methods impl blocks Fixes #57582. r? @QuietMisdreavus
This commit is contained in:
commit
064b787fc9
1 changed files with 20 additions and 2 deletions
|
@ -1886,12 +1886,30 @@ if (!DOMTokenList.prototype.remove) {
|
||||||
updateLocalStorage("rustdoc-collapse", "true");
|
updateLocalStorage("rustdoc-collapse", "true");
|
||||||
addClass(innerToggle, "will-expand");
|
addClass(innerToggle, "will-expand");
|
||||||
onEveryMatchingChild(innerToggle, "inner", function(e) {
|
onEveryMatchingChild(innerToggle, "inner", function(e) {
|
||||||
|
var parent = e.parentNode;
|
||||||
|
var superParent = null;
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
superParent = parent.parentNode;
|
||||||
|
}
|
||||||
|
if (!parent || !superParent || superParent.id !== "main" ||
|
||||||
|
hasClass(parent, "impl") === false) {
|
||||||
e.innerHTML = labelForToggleButton(true);
|
e.innerHTML = labelForToggleButton(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
innerToggle.title = "expand all docs";
|
innerToggle.title = "expand all docs";
|
||||||
if (fromAutoCollapse !== true) {
|
if (fromAutoCollapse !== true) {
|
||||||
onEachLazy(document.getElementsByClassName("collapse-toggle"), function(e) {
|
onEachLazy(document.getElementsByClassName("collapse-toggle"), function(e) {
|
||||||
|
var parent = e.parentNode;
|
||||||
|
var superParent = null;
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
superParent = parent.parentNode;
|
||||||
|
}
|
||||||
|
if (!parent || !superParent || superParent.id !== "main" ||
|
||||||
|
hasClass(parent, "impl") === false) {
|
||||||
collapseDocs(e, "hide", pageId);
|
collapseDocs(e, "hide", pageId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue