Skip to content

Commit af187c7

Browse files
committed
- another attempt at blindly fixing the copyOutput method
1 parent 587224d commit af187c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/verbose_o_matic.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,18 +474,18 @@ <h1>Verbose-O-Matic</h1>
474474
}
475475

476476
async function copyOutput(event) {
477-
const btn = event.target.closest('.copy-btn');
478-
const originalContent = btn.innerHTML;
479-
480477
try {
481478
await navigator.clipboard.writeText(document.getElementById('outputText').textContent);
482479

480+
const btn = event.target.closest('.copy-btn');
481+
const originalHTML = btn.innerHTML;
482+
483483
btn.classList.add('copied');
484484
btn.innerHTML = '<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg> Copied!';
485485

486486
setTimeout(() => {
487487
btn.classList.remove('copied');
488-
btn.innerHTML = originalContent;
488+
btn.innerHTML = originalHTML;
489489
}, 2000);
490490
} catch {
491491
showAlert('Failed to copy to clipboard', 'error');

0 commit comments

Comments
 (0)