[Glitch] Fix edge case where settings/admin page sidebar would be incorrectly hidden
Port ab98d2e539
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
parent
5718a2e280
commit
a564a06739
|
@ -147,13 +147,7 @@ function main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||||
const target = document.querySelector('.sidebar ul');
|
document.querySelector('.sidebar ul').classList.toggle('visible');
|
||||||
|
|
||||||
if (target.style.display === 'block') {
|
|
||||||
target.style.display = 'none';
|
|
||||||
} else {
|
|
||||||
target.style.display = 'block';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Empty the honeypot fields in JS in case something like an extension
|
// Empty the honeypot fields in JS in case something like an extension
|
||||||
|
|
|
@ -7,13 +7,7 @@ function main() {
|
||||||
const { delegate } = require('@rails/ujs');
|
const { delegate } = require('@rails/ujs');
|
||||||
|
|
||||||
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||||
const target = document.querySelector('.sidebar ul');
|
document.querySelector('.sidebar ul').classList.toggle('visible');
|
||||||
|
|
||||||
if (target.style.display === 'block') {
|
|
||||||
target.style.display = 'none';
|
|
||||||
} else {
|
|
||||||
target.style.display = 'block';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -322,6 +322,10 @@ $content-width: 840px;
|
||||||
|
|
||||||
& > ul {
|
& > ul {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
&.visible {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ul a,
|
ul a,
|
||||||
|
|
Loading…
Reference in New Issue