From f3e07fd51ce591af133ee2046877f769a1fe490f Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 06 Aug 2024 01:38:07 +0000
Subject: [PATCH] chore(deps-dev): bump prettier from 3.3.2 to 3.3.3 (#1293)
---
quartz/components/scripts/clipboard.inline.ts | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/quartz/components/scripts/clipboard.inline.ts b/quartz/components/scripts/clipboard.inline.ts
index c604c9b..87182a1 100644
--- a/quartz/components/scripts/clipboard.inline.ts
+++ b/quartz/components/scripts/clipboard.inline.ts
@@ -14,7 +14,7 @@
button.type = "button"
button.innerHTML = svgCopy
button.ariaLabel = "Copy source"
- button.addEventListener("click", () => {
+ function onClick() {
navigator.clipboard.writeText(source).then(
() => {
button.blur()
@@ -26,7 +26,9 @@
},
(error) => console.error(error),
)
- })
+ }
+ button.addEventListener("click", onClick)
+ window.addCleanup(() => button.removeEventListener("click", onClick))
els[i].prepend(button)
}
}
--
Gitblit v1.10.0