diff options
author | Arne Hamann <kontakt+github@arne.email> | 2019-09-05 22:49:40 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-09-19 22:29:18 +0200 |
commit | 0b3bbddde1e381b3762b6d9da6f89f7f0fa7a5d5 (patch) | |
tree | 3e93c1ca2d1ed82c67180fc613c8748a4eb50bfb /src/components | |
parent | ccb6828f693fdf102c5a14a8284e46c8fd69d7c7 (diff) |
Added posibility to show and edit vCard Geo attibutes
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ContactDetails/ContactDetailsAddNewProp.vue | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/components/ContactDetails/ContactDetailsAddNewProp.vue b/src/components/ContactDetails/ContactDetailsAddNewProp.vue index 1400d624..abb2985a 100644 --- a/src/components/ContactDetails/ContactDetailsAddNewProp.vue +++ b/src/components/ContactDetails/ContactDetailsAddNewProp.vue @@ -39,6 +39,7 @@ import rfcProps from 'Models/rfcProps' import Contact from 'Models/contact' import PropertyTitle from 'Components/Properties/PropertyTitle' +import ICAL from 'ical.js' export default { name: 'ContactDetailsAddNewProp', @@ -101,10 +102,17 @@ export default { * @param {string} data.id the id of the property. e.g fn */ addProp({ id }) { - let defaultData = this.properties[id].defaultValue - let property = this.contact.vCard.addPropertyWithValue(id, defaultData ? defaultData.value : '') - if (defaultData && defaultData.type) { - property.setParameter('type', defaultData.type) + if (this.properties[id] && this.properties[id].defaultjCal + && this.properties[id].defaultjCal[this.contact.version]) { + let defaultjCal = this.properties[id].defaultjCal[this.contact.version] + let property = new ICAL.Property([id, ...defaultjCal]) + this.contact.vCard.addProperty(property) + } else { + let defaultData = this.properties[id].defaultValue + let property = this.contact.vCard.addPropertyWithValue(id, defaultData ? defaultData.value : '') + if (defaultData && defaultData.type) { + property.setParameter('type', defaultData.type) + } } } } |