[Glitch] Fix edge case where settings/admin page sidebar would be incorrectly hidden

Port 00b45b967e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
pull/18878/head
Claire 2022-02-16 21:44:19 +01:00
parent 41d52ee4b5
commit d70e4e3da0
3 changed files with 6 additions and 14 deletions

View File

@ -147,13 +147,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

View File

@ -7,13 +7,7 @@ function main() {
const { delegate } = require('@rails/ujs');
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');
});
}

View File

@ -322,6 +322,10 @@ $content-width: 840px;
& > ul {
display: none;
&.visible {
display: block;
}
}
ul a,