]> cat aescling's git repositories - mastodon.git/commitdiff
Fix edge case where settings/admin page sidebar would be incorrectly hidden (#17580)
authorClaire <claire.github-309c@sitedethib.com>
Wed, 16 Feb 2022 20:44:19 +0000 (21:44 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Feb 2022 20:44:19 +0000 (21:44 +0100)
app/javascript/packs/public.js
app/javascript/styles/mastodon/admin.scss

index c0c0886461f5e1ca90ad3996294a19f3bc4dff40..3d0a937e1f80742c66775dda37b84d1b49c0aa1d 100644 (file)
@@ -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
index f5741bd502960c85a39310c26f2d411ed43c3180..1921eb1466ebe5455d4ecdf2434ecebfe3187fb3 100644 (file)
@@ -322,6 +322,10 @@ $content-width: 840px;
 
       & > ul {
         display: none;
+
+        &.visible {
+          display: block;
+        }
       }
 
       ul a,