Keep focus when copy Share-Link
Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
parent
a7641c9e75
commit
8f2c62ddf7
|
@ -184,7 +184,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
async copyLink() {
|
||||
async copyLink(event) {
|
||||
if (this.$clipboard(this.formLink)) {
|
||||
this.copySuccess = true
|
||||
this.copied = true
|
||||
|
@ -193,6 +193,9 @@ export default {
|
|||
this.copied = true
|
||||
console.debug('Not possible to copy share link')
|
||||
}
|
||||
// Set back focus as clipboard removes focus
|
||||
event.target.focus()
|
||||
|
||||
setTimeout(() => {
|
||||
this.copySuccess = false
|
||||
this.copied = false
|
||||
|
|
|
@ -161,13 +161,15 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
copyShareLink() {
|
||||
copyShareLink(event) {
|
||||
const $formLink = window.location.protocol + '//' + window.location.host + generateUrl(`/apps/forms/${this.form.hash}`)
|
||||
if (this.$clipboard($formLink)) {
|
||||
showSuccess(t('forms', 'Form link copied'))
|
||||
} else {
|
||||
showError(t('forms', 'Cannot copy, please copy the link manually'))
|
||||
}
|
||||
// Set back focus as clipboard removes focus
|
||||
event.target.focus()
|
||||
},
|
||||
|
||||
async loadFormResults() {
|
||||
|
|
|
@ -323,12 +323,14 @@ export default {
|
|||
return datetime < moment().add(1, 'hour').toDate()
|
||||
},
|
||||
|
||||
copyShareLink() {
|
||||
copyShareLink(event) {
|
||||
if (this.$clipboard(this.shareLink)) {
|
||||
showSuccess(t('forms', 'Form link copied'))
|
||||
} else {
|
||||
showError(t('forms', 'Cannot copy, please copy the link manually'))
|
||||
}
|
||||
// Set back focus as clipboard removes focus
|
||||
event.target.focus()
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue