Skip to content

Commit

Permalink
Prevent automatic collapse of methods impl blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 4, 2019
1 parent 19f8958 commit d0f88c4
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/librustdoc/html/static/main.js
Expand Up @@ -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);
}
});
}
}
Expand Down

0 comments on commit d0f88c4

Please sign in to comment.