|
|
|
@ -99,9 +99,16 @@ async function copy (button) {
|
|
|
|
button.dispatchEvent(new CustomEvent('clipboard-copy', { bubbles: true }))
|
|
|
|
button.dispatchEvent(new CustomEvent('clipboard-copy', { bubbles: true }))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toggleActiveIcon () {
|
|
|
|
|
|
|
|
if (button.classList.contains('swap')) {
|
|
|
|
|
|
|
|
button.classList.toggle('swap-active')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (text) {
|
|
|
|
if (text) {
|
|
|
|
await copyText(text)
|
|
|
|
await copyText(text)
|
|
|
|
trigger()
|
|
|
|
trigger()
|
|
|
|
|
|
|
|
toggleActiveIcon()
|
|
|
|
} else if (id) {
|
|
|
|
} else if (id) {
|
|
|
|
const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument
|
|
|
|
const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument
|
|
|
|
|
|
|
|
|
|
|
|
@ -112,6 +119,7 @@ async function copy (button) {
|
|
|
|
if (node) {
|
|
|
|
if (node) {
|
|
|
|
await copyTarget(node)
|
|
|
|
await copyTarget(node)
|
|
|
|
trigger()
|
|
|
|
trigger()
|
|
|
|
|
|
|
|
toggleActiveIcon()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|