diff options
Diffstat (limited to 'app/static/js')
| -rw-r--r-- | app/static/js/bulma.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/static/js/bulma.js b/app/static/js/bulma.js index 49b9b93..66ccd0c 100644 --- a/app/static/js/bulma.js +++ b/app/static/js/bulma.js @@ -40,3 +40,16 @@ document.addEventListener('keydown', (event) => { closeAllModals(); } }); + +// Navbar burger +Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0).forEach(el => { + el.addEventListener('click', () => { + // Get the target from the "data-target" attribute + const target = el.dataset.target; + const $target = document.getElementById(target); + + // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" + el.classList.toggle('is-active'); + $target.classList.toggle('is-active'); + }); +}) |
