Skip to content

Commit

Permalink
Merge pull request surjithctly#13 from mnokeefe/fix-view-transitions
Browse files Browse the repository at this point in the history
View transitions support
  • Loading branch information
surjithctly authored Sep 15, 2023
2 parents 84125a0 + 868bb65 commit 5b51983
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Astronav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { closeOnClick = false } = Astro.props;
<slot />

<script define:vars={{ closeOnClick }}>
document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("astro:page-load", () => {
// Mobile nav toggle
const menuButton = document.getElementById("astronav-menu");
menuButton && menuButton.addEventListener("click", toggleMobileNav);
Expand Down Expand Up @@ -44,7 +44,7 @@ document.addEventListener("DOMContentLoaded", () => {
if (closeOnClick) {
handleCloseOnClick();
}
});
}, { once: true });

function toggleMobileNav() {
[...document.querySelectorAll(".astronav-toggle")].forEach((el) => {
Expand Down

0 comments on commit 5b51983

Please sign in to comment.