File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments