diff options
author | Cyrille Bollu <cyr.debian@bollu.be> | 2022-01-19 17:37:17 +0300 |
---|---|---|
committer | Cyrille Bollu <cyr.debian@bollu.be> | 2022-01-27 13:28:41 +0300 |
commit | 3a9b83091ea5131292a2634da58f2d7fb9510b43 (patch) | |
tree | df7a72b481eb4db9cefd5411a1d6da756ce2957b /src | |
parent | 8aabd4dede1ff2f7021b018e72a9aee35595e268 (diff) |
Adds clipboard support to Mail and adds an action to RecipientBubbles to
copy their email address to the clipboard.
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/RecipientBubble.vue | 8 | ||||
-rw-r--r-- | src/main.js | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/components/RecipientBubble.vue b/src/components/RecipientBubble.vue index b34156ef8..743843b4b 100644 --- a/src/components/RecipientBubble.vue +++ b/src/components/RecipientBubble.vue @@ -46,6 +46,9 @@ <a class="icon-add" @click="selection = ContactSelectionStateEnum.new"> <span class="action-label">{{ t('mail', 'New Contact') }}</span> </a> + <a class="icon-clippy" @click="onClickCopyToClipboard"> + <span class="action-label">{{ t('mail', 'Copy to clipboard') }}</span> + </a> </div> <div v-else class="contact-input-wrapper"> <Multiselect @@ -167,6 +170,9 @@ export default { this.newContactName = this.label }, methods: { + onClickCopyToClipboard() { + this.$copyText(this.email) + }, onClickReply() { this.$router.push({ name: 'message', @@ -241,6 +247,7 @@ export default { width: 100%; } } +.icon-clippy, .icon-user, .icon-reply, .icon-checkmark, @@ -252,6 +259,7 @@ export default { padding: 9px 18px 10px 32px; } @media only screen and (min-width: 600px) { + .icon-clippy, .icon-user, .icon-reply, .icon-checkmark, diff --git a/src/main.js b/src/main.js index e19b4ab3d..6b791fcae 100644 --- a/src/main.js +++ b/src/main.js @@ -28,6 +28,7 @@ import '@nextcloud/dialogs/styles/toast.scss' import './directives/drag-and-drop/styles/drag-and-drop.scss' import VueShortKey from 'vue-shortkey' import VTooltip from 'v-tooltip' +import VueClipboard from 'vue-clipboard2' import App from './App' import Nextcloud from './mixins/Nextcloud' @@ -47,6 +48,7 @@ Vue.mixin(Nextcloud) Vue.use(VueShortKey, { prevent: ['input', 'div'] }) Vue.use(VTooltip) +Vue.use(VueClipboard) const getPreferenceFromPage = (key) => { const elem = document.getElementById(key) |