mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 07:39:23 -04:00
Add success popup message for copying share links
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit 08e15308cb)
This commit is contained in:
parent
890da5a9b1
commit
1fe8baffec
4 changed files with 14 additions and 9 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
<script>
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { showSuccess } from '@nextcloud/dialogs'
|
||||
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink'
|
||||
import SharingEntrySimple from './SharingEntrySimple'
|
||||
|
||||
|
|
@ -65,9 +66,10 @@ export default {
|
|||
*/
|
||||
clipboardTooltip() {
|
||||
if (this.copied) {
|
||||
return this.copySuccess
|
||||
? t('files_sharing', 'Link copied')
|
||||
: t('files_sharing', 'Cannot copy, please copy the link manually')
|
||||
if (this.copySuccess) {
|
||||
return ''
|
||||
}
|
||||
return t('files_sharing', 'Cannot copy, please copy the link manually')
|
||||
}
|
||||
return t('files_sharing', 'Copy to clipboard')
|
||||
},
|
||||
|
|
@ -84,6 +86,7 @@ export default {
|
|||
async copyLink() {
|
||||
try {
|
||||
await this.$copyText(this.internalLink)
|
||||
showSuccess(t('files_sharing', 'Link copied'))
|
||||
// focus and show the tooltip (note: cannot set ref on NcActionLink)
|
||||
this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus()
|
||||
this.copySuccess = true
|
||||
|
|
|
|||
|
|
@ -564,9 +564,10 @@ export default {
|
|||
*/
|
||||
clipboardTooltip() {
|
||||
if (this.copied) {
|
||||
return this.copySuccess
|
||||
? t('files_sharing', 'Link copied')
|
||||
: t('files_sharing', 'Cannot copy, please copy the link manually')
|
||||
if (this.copySuccess) {
|
||||
return ''
|
||||
}
|
||||
return t('files_sharing', 'Cannot copy, please copy the link manually')
|
||||
}
|
||||
return t('files_sharing', 'Copy to clipboard')
|
||||
},
|
||||
|
|
@ -773,6 +774,7 @@ export default {
|
|||
async copyLink() {
|
||||
try {
|
||||
await this.$copyText(this.shareLink)
|
||||
showSuccess(t('files_sharing', 'Link copied'))
|
||||
// focus and show the tooltip
|
||||
this.$refs.copyButton.$el.focus()
|
||||
this.copySuccess = true
|
||||
|
|
|
|||
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue