diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-06-16 07:24:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-16 07:24:42 +0900 |
| commit | ad61ae59bf3a3d64fc724bb4d6b32eba33b01671 (patch) | |
| tree | 96d73e38fb8a183bc6048a0bf1fafdcccfca9888 /src/librustdoc | |
| parent | b91c4d5b45484ad3c121e2f738a31195f49374aa (diff) | |
| parent | a70c14aecca90e29417ab3c9b9dcbf0631efae79 (diff) | |
Rollup merge of #98092 - GuillaumeGomez:fix-sidebar-items-expand-collapse, r=notriddle
Fix sidebar items expand collapse The collapse/expand event was not working for the items in the source code viewer sidebar (talking about these items:  ). This PR fixes it and adds a GUI test to prevent another regression. r? ```@notriddle```
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/html/static/js/source-script.js | 6 |
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"]; |
