mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2026-09-22 00:34:55 -05:00
js: Fix copy to clipboard button stuck as "Copied" when clicked twice
This commit is contained in:
@@ -14,9 +14,8 @@ async function copy_to_clipboard(button) {
|
||||
await navigator.clipboard.writeText(rawCode);
|
||||
|
||||
// TODO: maybe we could add a fancier indicator, like a flash or something
|
||||
const originalCopyText = button.innerHTML;
|
||||
button.innerHTML = "Copied!";
|
||||
setTimeout(() => {
|
||||
button.innerHTML = originalCopyText;
|
||||
button.innerHTML = "{{ i18n "copy_to_clipboard" }}";
|
||||
}, 3000);
|
||||
}
|
||||
@@ -19,8 +19,10 @@
|
||||
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" media="print" onload="this.media='all'">
|
||||
{{ end }}
|
||||
|
||||
{{ with resources.Get "js/bobatheme.js" | fingerprint "sha512" }}
|
||||
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ with resources.Get "js/bobatheme.tmpl.js" }}
|
||||
{{ with resources.ExecuteAsTemplate "js/bobatheme.js" $ . | fingerprint "sha512" }}
|
||||
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if not hugo.IsServer }}
|
||||
<script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.outbound-links.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user