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:
Guillaume Gomez 2019-02-07 14:28:38 +01:00 committed by GitHub
commit 064b787fc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1886,12 +1886,30 @@ if (!DOMTokenList.prototype.remove) {
updateLocalStorage("rustdoc-collapse", "true");
addClass(innerToggle, "will-expand");
onEveryMatchingChild(innerToggle, "inner", function(e) {
e.innerHTML = labelForToggleButton(true);
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);
}
});
innerToggle.title = "expand all docs";
if (fromAutoCollapse !== true) {
onEachLazy(document.getElementsByClassName("collapse-toggle"), function(e) {
collapseDocs(e, "hide", pageId);
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);
}
});
}
}