Skip to content

Commit

Permalink
js: make copy message disappear after 3 secs
Browse files Browse the repository at this point in the history
  • Loading branch information
paveyry committed Mar 22, 2021
1 parent f82b9d0 commit 1212a5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ function inject(){
await navigator.clipboard.writeText(text);
event.target.innerText = 'SUCCESSFULLY COPIED TO CLIPBOARD';
event.target.style.color = 'green';
setTimeout(function(){
event.target.innerText = "COPY TO CLIPBOARD";
event.target.style.color = "#1a73e8";
}, 3000);
} catch (err) {
event.target.innerText = 'FAILED TO COPY';
event.target.style.color = 'red';
Expand Down

0 comments on commit 1212a5e

Please sign in to comment.