Skip to content

Commit

Permalink
Fixed Bug: No menu on mobile /newhome OWASP-BLT#1696 (OWASP-BLT#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
kr-2003 authored Feb 4, 2024
1 parent 6619a2d commit 97e60bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion website/templates/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="flex items-center justify-between">
<div class="flex items-center justify-start rtl:justify-end">
<!-- Ham Menu -->
<button data-drawer-target="logo-sidebar" data-drawer-toggle="logo-sidebar" aria-controls="logo-sidebar" type="button" class="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg lg:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600">
<button id="hamburger-button" data-drawer-target="logo-sidebar" data-drawer-toggle="logo-sidebar" aria-controls="logo-sidebar" type="button" class="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg lg:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600">
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path>
</svg>
Expand Down
9 changes: 9 additions & 0 deletions website/templates/includes/sidenav.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,13 @@
</li>
</ul>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
const hamburgerButton = document.getElementById('hamburger-button');
const sidebar = document.getElementById('sidebar');
hamburgerButton.addEventListener('click', function () {
sidebar.classList.toggle('-translate-x-full');
});
});
</script>
</aside>

0 comments on commit 97e60bb

Please sign in to comment.