Skip to content

Commit

Permalink
feat(tmpl): toggle check on copy from history row
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Apr 2, 2021
1 parent 9cea00f commit 93d47cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tmpl/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
width: 100%;
}
.th-code {
width: 10%;
width: 12%;
}
.th-url {
width: 90%;
width: 88%;
}
.copy-url {
cursor: pointer;
Expand Down Expand Up @@ -170,7 +170,10 @@ <h4 class="subtitle">
setTimeout(loadHistory, 500)
document.addEventListener('click', e => {
if (e.target && e.target.classList.contains('copy-url')) {
navigator.clipboard.writeText(e.target.dataset.shortUrl)
navigator.clipboard.writeText(e.target.dataset.shortUrl).then(_ => {
e.target.classList.replace('fa-copy', 'fa-check')
setTimeout(_ => e.target.classList.replace('fa-check', 'fa-copy'), 2000)
})
}
})
</script>
Expand Down

0 comments on commit 93d47cd

Please sign in to comment.