Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0ccc6d4

Browse files
committed
fix navbar burger menu on mobile
1 parent 0bcb350 commit 0ccc6d4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

KratosSelfService/Views/Shared/_NavbarLayout.cshtml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@
4949
</div>
5050
</div>
5151
</div>
52+
<script type="text/javascript">
53+
document.addEventListener('DOMContentLoaded', () => {
54+
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
55+
$navbarBurgers.forEach( el => {
56+
el.addEventListener('click', () => {
57+
const target = el.dataset.target;
58+
const $target = document.getElementById(target);
59+
el.classList.toggle('is-active');
60+
$target.classList.toggle('is-active');
61+
});
62+
});
63+
});
64+
</script>
5265
</nav>
5366

5467
<main>

0 commit comments

Comments
 (0)