Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nano2dev committed Feb 15, 2024
1 parent 31a891a commit d2f2885
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@
}

window.NanoPay.CopyToClipboard = function(text, el) {
var self = this
navigator.clipboard.writeText(text).then(function() {
var span = el.getElementsByTagName("span")
var default_text = span[0].innerText
span[0].innerText = 'Copied!'
setTimeout(() => span[0].innerText = default_text, 2000)
if (span) {
var default_text = span[0].innerText
span[0].innerText = 'Copied!'
setTimeout(() => span[0].innerText = default_text, 2000)
}
}, function() {
document.execCommand("copy");
})
Expand Down

0 comments on commit d2f2885

Please sign in to comment.