about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-12-15 16:43:21 +0100
committerGitHub <noreply@github.com>2020-12-15 16:43:21 +0100
commitbfe49a0aa3a6cbcdbf291313e1765f5c8408b6e8 (patch)
treecb9a8b0f843bcf224d444ade1e52618fb50080ff
parent275599daa5ff115c85826861ba0114b4b3edf28a (diff)
parent99df3406cf419cb5e45f5ee59c7b04cb294630c5 (diff)
downloadrust-bfe49a0aa3a6cbcdbf291313e1765f5c8408b6e8.tar.gz
rust-bfe49a0aa3a6cbcdbf291313e1765f5c8408b6e8.zip
Rollup merge of #79796 - GuillaumeGomez:hide-associated-const-when-collapsing, r=jyn514
Hide associated constants too when collapsing implementation

Fixes #71849.

r? `@jyn514`
-rw-r--r--src/librustdoc/html/static/main.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 47847ccb5f6..1de4b0016c5 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2274,9 +2274,12 @@ function defocusSearchBar() {
 
         function implHider(addOrRemove, fullHide) {
             return function(n) {
-                var is_method = hasClass(n, "method") || fullHide;
-                if (is_method || hasClass(n, "type")) {
-                    if (is_method === true) {
+                var shouldHide =
+                    fullHide === true ||
+                    hasClass(n, "method") === true ||
+                    hasClass(n, "associatedconstant") === true;
+                if (shouldHide === true || hasClass(n, "type") === true) {
+                    if (shouldHide === true) {
                         if (addOrRemove) {
                             addClass(n, "hidden-by-impl-hider");
                         } else {