kyledinh / zio-blogapp

A Zio, Scala 3, Postgres, ScalaJS, Laminar App
Apache License 2.0
20 stars 2 forks source link

Fix the Hamburger Menu Button #16

Open kyledinh opened 1 year ago

kyledinh commented 1 year ago

Added jQuery and event-handler to the index.html (https://github.com/kyledinh/zio-blogapp/issues/13) to get the menu to uncollapse.

But afterward, the menu won't collapse:

collapsing-hamburger-menu
kyledinh commented 1 year ago

Temp Fix, make the dropdown last for 5 seconds:

<!-- Navbar toggle fix/hack will show dropdown menu for 5 seconds !!! -->
<script>
    document.addEventListener('readystatechange', event => { 
        const navButton = document.getElementById("navButton");
        const navBarElem = document.getElementById("navbarResponsive");
        const toggleNavbarEvent = (e) => {
            setTimeout(function(){
                navBarElem.classList.toggle("show");
            }, 5000);
        }
        navButton.addEventListener("click", toggleNavbarEvent);
    });
</script>