mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2026-09-22 08:44: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);
|
||||
}
|
||||
Reference in New Issue
Block a user