Skip to content

Commit

Permalink
🛠️ about CopyButton
Browse files Browse the repository at this point in the history
  • Loading branch information
EveSunMaple committed Oct 25, 2024
1 parent 9bc6150 commit ce51f6a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ const { title, image, includeSidebar = true } = Astro.props;
});
});

document.addEventListener("DOMContentLoaded", () => {
const astroPageLoadEvent = new Event("swup:page:view");
document.addEventListener("swup:page:view", () => {
addCopyButton();
const astroPageLoadEvent = new Event("astro:page-load");
document.dispatchEvent(astroPageLoadEvent);
});

document.addEventListener("swup:page:view", () => {
const astroPageLoadEvent = new Event("astro:page-load");
document.addEventListener("DOMContentLoaded", () => {
const astroPageLoadEvent = new Event("swup:page:view");
document.dispatchEvent(astroPageLoadEvent);
addCopyButton;
});
</script>

0 comments on commit ce51f6a

Please sign in to comment.