Skip to content

Commit

Permalink
Please refactor me
Browse files Browse the repository at this point in the history
  • Loading branch information
decabeza committed Apr 29, 2024
1 parent e44aebc commit af35d92
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/components/layout/responsive_menu_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
<span data-responsive-toggle="responsive_menu" data-hide-for="medium">
<button type="button" class="menu-button" data-toggle>
<button type="button" class="menu-button" data-toggle onclick="toggleMenu()">
<span class="menu-icon"></span>
<%= t("application.menu") %>
</button>
</span>

<div id="responsive_menu" class="responsive-menu">
<div id="responsive_menu" class="responsive-menu" aria-expanded="false">
<%= content %>
</div>

<script>
function toggleMenu() {
var menu = document.getElementById("responsive_menu");
var expanded = menu.getAttribute("aria-expanded");
if (expanded === "true") {
menu.setAttribute("aria-expanded", "false");
} else {
menu.setAttribute("aria-expanded", "true");
}
}
</script>

0 comments on commit af35d92

Please sign in to comment.