Skip to content

Commit

Permalink
Add JS handler for hamburger menu
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickjfl committed Oct 18, 2024
1 parent 8ac06ef commit fb9a5b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
// Entry point for the build script in your package.json
import "@hotwired/turbo-rails";

document.addEventListener("DOMContentLoaded", function () {
const hamburgerMenu = document.getElementById("hamburger-menu");
const menuList = document.getElementById("menu-list");

hamburgerMenu.addEventListener("click", function () {
menuList.classList.toggle("hidden");
});
});

0 comments on commit fb9a5b8

Please sign in to comment.