about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-06-14 10:59:01 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-06-14 10:59:01 +0200
commitdf9fea24a58eba9476aaeccc350441634eaf5eae (patch)
tree7fd8729a30e65744476a9395e3821fcb97af4a53 /src/librustdoc/html/static/js/source-script.js
parentae2aa18d7467e212c4e961378b1061628abdb358 (diff)
downloadrust-df9fea24a58eba9476aaeccc350441634eaf5eae.tar.gz
rust-df9fea24a58eba9476aaeccc350441634eaf5eae.zip
Fix expand/collapse on source viewer sidebar folders
Diffstat (limited to 'src/librustdoc/html/static/js/source-script.js')
-rw-r--r--src/librustdoc/html/static/js/source-script.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/js/source-script.js b/src/librustdoc/html/static/js/source-script.js
index 58c036e0b3c..14d8a942977 100644
--- a/src/librustdoc/html/static/js/source-script.js
+++ b/src/librustdoc/html/static/js/source-script.js
@@ -32,10 +32,10 @@ function createDirEntry(elem, parent, fullPath, currentFile, hasFoundFile) {
     fullPath += elem["name"] + "/";
 
     name.onclick = () => {
-        if (hasClass(this, "expand")) {
-            removeClass(this, "expand");
+        if (hasClass(name, "expand")) {
+            removeClass(name, "expand");
         } else {
-            addClass(this, "expand");
+            addClass(name, "expand");
         }
     };
     name.innerText = elem["name"];