mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 14:00:05 +02:00
9 lines
357 B
TypeScript
9 lines
357 B
TypeScript
const toggleButton = document.getElementById('navbar-toggle-btn') as HTMLElement
|
|
|
|
toggleButton?.addEventListener('click', () => {
|
|
// Delay allows Bootstrap to update aria-expanded first
|
|
setTimeout(() => {
|
|
const isExpanded = toggleButton.getAttribute('aria-expanded') === 'true'
|
|
document.body.classList.toggle('no-scroll', isExpanded)
|
|
}, 5)
|
|
})
|