forked from shibao/cannery
add copy to clipboard for invites
This commit is contained in:
@ -56,3 +56,13 @@ liveSocket.connect()
|
||||
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
|
||||
// >> liveSocket.disableLatencySim()
|
||||
window.liveSocket = liveSocket
|
||||
|
||||
// Copy to clipboard
|
||||
window.addEventListener('cannery:clipcopy', (event) => {
|
||||
if ('clipboard' in navigator) {
|
||||
const text = event.target.textContent
|
||||
navigator.clipboard.writeText(text)
|
||||
} else {
|
||||
window.alert('Sorry, your browser does not support clipboard copy.')
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user