about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-16 21:44:19 +0100
committerGitHub <noreply@github.com>2022-02-16 21:44:19 +0100
commit00b45b967e0c92714e1ec54a2d5c924f8b1dd38b (patch)
treed5189ec36775822501a8c4b6b0d13579ecff3b55 /app/javascript
parent1abf0f90000c86bfbc5d6ac9a976834dcd17983a (diff)
Fix edge case where settings/admin page sidebar would be incorrectly hidden (#17580)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/packs/public.js8
-rw-r--r--app/javascript/styles/mastodon/admin.scss4
2 files changed, 5 insertions, 7 deletions
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js
index c0c088646..3d0a937e1 100644
--- a/app/javascript/packs/public.js
+++ b/app/javascript/packs/public.js
@@ -276,13 +276,7 @@ function main() {
   });
 
   delegate(document, '.sidebar__toggle__icon', 'click', () => {
-    const target = document.querySelector('.sidebar ul');
-
-    if (target.style.display === 'block') {
-      target.style.display = 'none';
-    } else {
-      target.style.display = 'block';
-    }
+    document.querySelector('.sidebar ul').classList.toggle('visible');
   });
 
   // Empty the honeypot fields in JS in case something like an extension
diff --git a/app/javascript/styles/mastodon/admin.scss b/app/javascript/styles/mastodon/admin.scss
index f5741bd50..1921eb146 100644
--- a/app/javascript/styles/mastodon/admin.scss
+++ b/app/javascript/styles/mastodon/admin.scss
@@ -322,6 +322,10 @@ $content-width: 840px;
 
       & > ul {
         display: none;
+
+        &.visible {
+          display: block;
+        }
       }
 
       ul a,