From 9d8de1e30ab0b855add8984c431b5149a9ecc824 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 21 Oct 2018 19:22:21 +0200 Subject: [PATCH] Fix script to avoid displaying unnecessary items --- src/librustdoc/html/static/main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 75e8eaf5753..dbcb2df3cf9 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -2069,16 +2069,20 @@ if (hasClass(this, "collapsed")) { removeClass(this, "collapsed"); onEach(this.parentNode.getElementsByClassName("hidden"), function(x) { - removeClass(x, "hidden"); - addClass(x, "x"); + if (hasClass(x, "content") === false) { + removeClass(x, "hidden"); + addClass(x, "x"); + } }, true); this.innerHTML = "[" + labelForToggleButton(false) + "] Hide default items" } else { addClass(this, "collapsed"); onEach(this.parentNode.getElementsByClassName("x"), function(x) { - addClass(x, "hidden"); - removeClass(x, "x"); + if (hasClass(x, "content") === false) { + addClass(x, "hidden"); + removeClass(x, "x"); + } }, true); this.innerHTML = "[" + labelForToggleButton(true) + "] Show hidden default items";