diff options
| author | Vitaly _Vi Shukela <vi0oss@gmail.com> | 2018-02-01 16:53:29 +0300 |
|---|---|---|
| committer | Vitaly _Vi Shukela <vi0oss@gmail.com> | 2018-02-01 16:53:29 +0300 |
| commit | a3acd10297ec7ddc4d1389cbf3532351f1d4a8c8 (patch) | |
| tree | 86231d80e63dd14f62d945c78c0dd3478d1ad5ba | |
| parent | 0885865e9065d6ef5a8b456b9665a63e9ffda290 (diff) | |
| download | rust-a3acd10297ec7ddc4d1389cbf3532351f1d4a8c8.tar.gz rust-a3acd10297ec7ddc4d1389cbf3532351f1d4a8c8.zip | |
rustdoc: Auto-collapse all non-inherent impls
| -rw-r--r-- | src/librustdoc/html/static/main.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 8ce1a2f84a1..befa1cc53f3 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1742,6 +1742,20 @@ } } + function autoCollapseAllImpls() { + // Automatically minimize all non-inherent impls + onEach(document.getElementsByClassName('impl'), function(n) { + if (n.id !== 'impl') { + // non-inherent impl + onEach(n.childNodes, function(m) { + if (hasClass(m, "collapse-toggle")) { + collapseDocs(m, "hide"); + } + }); + } + }); + } + var x = document.getElementById('toggle-all-docs'); if (x) { x.onclick = toggleAllDocs; @@ -1819,6 +1833,8 @@ } }) + autoCollapseAllImpls(); + function createToggleWrapper() { var span = document.createElement('span'); span.className = 'toggle-label'; |
