1
Fork 0

Add setting to prevent doc auto-hide of trait implementations

This commit is contained in:
Guillaume Gomez 2018-07-08 15:07:06 +02:00
parent 0c0315cfd9
commit c0ec5d5e44
2 changed files with 14 additions and 10 deletions

View file

@ -1938,17 +1938,19 @@
if (collapse) {
toggleAllDocs(pageId, true);
}
onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
// inherent impl ids are like 'impl' or impl-<number>'.
// they will never be hidden by default.
var n = e.parentNode;
if (n.id.match(/^impl(?:-\d+)?$/) === null) {
// Automatically minimize all non-inherent impls
if (collapse || hasClass(n, 'impl')) {
collapseDocs(e, "hide", pageId);
if (getCurrentValue('rustdoc-trait-implementations') !== "false") {
onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
// inherent impl ids are like 'impl' or impl-<number>'.
// they will never be hidden by default.
var n = e.parentNode;
if (n.id.match(/^impl(?:-\d+)?$/) === null) {
// Automatically minimize all non-inherent impls
if (collapse || hasClass(n, 'impl')) {
collapseDocs(e, "hide", pageId);
}
}
}
});
});
}
}
var x = document.getElementById('toggle-all-docs');