Rollup merge of #52151 - GuillaumeGomez:trait-impl-settings, r=QuietMisdreavus
Trait impl settings Fixes #51797. r? @QuietMisdreavus PS: I was annoyed by some intra link failures so I fixed them as well.
This commit is contained in:
commit
f7c2efddc7
4 changed files with 18 additions and 14 deletions
|
|
@ -1669,6 +1669,8 @@ impl<'a> Settings<'a> {
|
|||
settings: vec![
|
||||
("item-declarations", "Auto-hide item declarations.", true),
|
||||
("item-attributes", "Auto-hide item attributes.", true),
|
||||
("trait-implementations", "Auto-hide trait implementations documentation",
|
||||
true),
|
||||
("go-to-only-result", "Directly go to item in search if there is only one result",
|
||||
false),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue