1
Fork 0

Prevent automatic collapse of methods impl blocks

This commit is contained in:
Guillaume Gomez 2019-02-04 14:59:06 +01:00
parent 19f8958f82
commit d0f88c4da3

View file

@ -1887,12 +1887,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);
}
});
}
}