Skip to content

Commit 3e6a2fa

Browse files
ClearlyClaireatsu1125
authored andcommitted
Fix edge case where settings/admin page sidebar would be incorrectly hidden (mastodon#17580)
1 parent 204d970 commit 3e6a2fa

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

app/javascript/packs/public.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,7 @@ function main() {
151151
});
152152

153153
delegate(document, '.sidebar__toggle__icon', 'click', () => {
154-
const target = document.querySelector('.sidebar ul');
155-
156-
if (target.style.display === 'block') {
157-
target.style.display = 'none';
158-
} else {
159-
target.style.display = 'block';
160-
}
154+
document.querySelector('.sidebar ul').classList.toggle('visible');
161155
});
162156

163157
// Empty the honeypot fields in JS in case something like an extension

app/javascript/styles/mastodon/admin.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ $content-width: 840px;
322322

323323
& > ul {
324324
display: none;
325+
326+
&.visible {
327+
display: block;
328+
}
325329
}
326330

327331
ul a,

0 commit comments

Comments
 (0)