copy to clipboard text item url #782

This commit is contained in:
2020-07-29 18:15:29 +02:00
parent 68064c916a
commit 606d6e98a3
6 changed files with 143 additions and 100 deletions
+17 -1
View File
@@ -46,7 +46,16 @@ export default {
this.html = `<div` +
` class="tei${this.uuid === this.textid ? ' active' : ''}"` +
` data-uuid="${this.uuid}"` +
`>${this.tei}</div>`
`>` +
`<a` +
` href="http://${window.apipath}/items/${this.uuid}"` +
` title="Copy to clipboard ${this.uuid}"` +
` class="text-item-link"` +
` @click.prevent="onClickCopyClipboard"` +
`>` +
`<span class="mdi mdi-open-in-new" />` +
`</a>` +
`${this.tei}</div>`
this.parseLinks()
// this.parsePageBreaks()
// console.log('EdText: builded html', this.html)
@@ -143,6 +152,13 @@ export default {
onLeaveLink (e) {
// console.log('EdText onLeaveLink(e)', e)
this.$emit('onLeaveLink')
},
onClickCopyClipboard (e) {
e.preventDefault()
console.log('onClickCopyClipboard', e)
// navigator.clipboard.writeText(e.target.getAttribute('href'))
this.$copyText(e.target.getAttribute('href'))
return false
}
},
render (h) {