summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2022-07-15 17:57:43 +0200
committerRichard Steinmetz <richard@steinmetz.cloud>2022-07-15 17:57:43 +0200
commitc588ba1c96790b614129143af5aa8f0333f258ef (patch)
tree990f002014e9f8b2f4c32ba1a6d8f32f544286bb
parent34964dea6004b32d3f5d1219bcff50856ecd7177 (diff)
Fix copy to full name button
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
-rw-r--r--src/components/Actions/ActionCopyNtoFN.vue11
-rw-r--r--src/components/Properties/PropertyActions.vue11
2 files changed, 13 insertions, 9 deletions
diff --git a/src/components/Actions/ActionCopyNtoFN.vue b/src/components/Actions/ActionCopyNtoFN.vue
index 4f4335b8..771880b6 100644
--- a/src/components/Actions/ActionCopyNtoFN.vue
+++ b/src/components/Actions/ActionCopyNtoFN.vue
@@ -21,7 +21,7 @@
-->
<template>
- <ActionButton icon="icon-up" @click="copyNtoFN">
+ <ActionButton icon="icon-up" @click="copyNToFN">
{{ t('contacts', 'Copy to full name') }}
</ActionButton>
</template>
@@ -37,13 +37,12 @@ export default {
mixins: [ActionsMixin],
methods: {
copyNToFN() {
- console.info(this.component)
- if (this.component.contact.vCard.hasProperty('n')) {
+ if (this.component.localContact.vCard.hasProperty('n')) {
// Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.
// -> John Stevenson
- const n = this.component.contact.vCard.getFirstPropertyValue('n')
- this.component.contact.fullName = n.slice(0, 2).reverse().join(' ')
- this.component.updateContact()
+ const n = this.component.localContact.vCard.getFirstPropertyValue('n')
+ this.component.localContact.fullName = n.slice(0, 2).reverse().join(' ')
+ this.component.$emit('update')
}
},
},
diff --git a/src/components/Properties/PropertyActions.vue b/src/components/Properties/PropertyActions.vue
index c604de86..2d1388a3 100644
--- a/src/components/Properties/PropertyActions.vue
+++ b/src/components/Properties/PropertyActions.vue
@@ -28,9 +28,10 @@
</template>
{{ t('contacts', 'Delete') }}
</ActionButton>
- <Actions :is="action"
- v-for="(action, index) in actions"
- :key="index" />
+ <component v-for="action in actions"
+ :is="action"
+ :key="action.name"
+ :component="propertyComponent" />
</Actions>
</template>
@@ -53,6 +54,10 @@ export default {
type: Array,
default: () => [],
},
+ propertyComponent: {
+ type: Object,
+ required: true,
+ },
},
methods: {