fix: re-add js for mobile-sidebar
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kazhnuz 2024-06-10 21:52:51 +02:00
parent ef5483dd7e
commit 0723137efd
2 changed files with 11 additions and 0 deletions

View file

@ -45,6 +45,7 @@
<button id="mobile-button" class="menu-button"><svg class="icon icon-bars" alt=""><use xlink:href="#icon-bars"></use></svg> <span class="sr-only">Afficher le menu</span></button>
<!-- Footer -->
<?php echo Theme::js('mobile-sidebar.js'); ?>
<!-- Load Bludit Plugins: Site Body End -->
<?php Theme::plugins('siteBodyEnd'); ?>
</body>

10
js/mobile-sidebar.js Normal file
View file

@ -0,0 +1,10 @@
document.getElementById('mobile-button').addEventListener('click', function () {
const sidebar = document.getElementById('mobile-sidebar');
if (sidebar.classList.contains('hidden')) {
sidebar.classList.remove('hidden');
sidebar.classList.add('shown');
} else {
sidebar.classList.remove('shown');
sidebar.classList.add('hidden');
}
});