summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-10-25 08:45:35 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-10-25 08:45:35 +0200
commit98371eb2acf0ce2501ccbe91580e9f252b264b7e (patch)
treeb750cedddaedc9cdc563f46c18260890429c05c4 /src
parent7780971ef6aaf57da4fb04219f264dc38caeac4b (diff)
Design and readOnly fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/ContactDetails.vue6
-rw-r--r--src/components/ContactDetails/ContactDetailsAvatar.vue6
-rw-r--r--src/store/contacts.js5
3 files changed, 10 insertions, 7 deletions
diff --git a/src/components/ContactDetails.vue b/src/components/ContactDetails.vue
index 91fa18b7..049f44c1 100644
--- a/src/components/ContactDetails.vue
+++ b/src/components/ContactDetails.vue
@@ -48,17 +48,17 @@
<!-- fullname, org, title -->
<div id="contact-header-infos">
<h2>
- <input id="contact-fullname" v-model="contact.fullName" :disabled="!contact.addressbook.readOnly"
+ <input id="contact-fullname" v-model="contact.fullName" :disabled="contact.addressbook.readOnly"
:placeholder="t('contacts', 'Name')" type="text" autocomplete="off"
autocorrect="off" spellcheck="false" name="fullname"
value="" @input="debounceUpdateContact">
</h2>
<div id="details-org-container">
- <input id="contact-org" v-model="contact.org" :disabled="!contact.addressbook.readOnly"
+ <input id="contact-org" v-model="contact.org" :disabled="contact.addressbook.readOnly"
:placeholder="t('contacts', 'Company')" type="text" autocomplete="off"
autocorrect="off" spellcheck="false" name="org"
value="" @input="debounceUpdateContact">
- <input id="contact-title" v-model="contact.title" :disabled="!contact.addressbook.readOnly"
+ <input id="contact-title" v-model="contact.title" :disabled="contact.addressbook.readOnly"
:placeholder="t('contacts', 'Title')" type="text" autocomplete="off"
autocorrect="off" spellcheck="false" name="title"
value="" @input="debounceUpdateContact">
diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue
index 0a249d4a..2c17bccc 100644
--- a/src/components/ContactDetails/ContactDetailsAvatar.vue
+++ b/src/components/ContactDetails/ContactDetailsAvatar.vue
@@ -30,9 +30,9 @@ import rfcProps from '../../models/rfcProps';
<div class="contact-header-avatar__options">
<input id="contact-avatar-upload" type="file" class="hidden"
accept="image/*" @change="processFile">
- <label v-tooltip.auto="t('contacts', 'Upload a new picture')" for="contact-avatar-upload"
- class="icon-upload-white" @click="processFile" />
- <div v-if="maximizeAvatar" class="icon-delete-white" @click="removePhoto" />
+ <label v-tooltip.auto="t('contacts', 'Upload a new picture')" v-if="!contact.addressbook.readOnly"
+ for="contact-avatar-upload" class="icon-upload-white" @click="processFile" />
+ <div v-if="maximizeAvatar && !contact.addressbook.readOnly" class="icon-delete-white" @click="removePhoto" />
<a v-if="maximizeAvatar" :href="contact.url + '?photo'" class="icon-download-white" />
</div>
</div>
diff --git a/src/store/contacts.js b/src/store/contacts.js
index 4c5cdf8e..278829be 100644
--- a/src/store/contacts.js
+++ b/src/store/contacts.js
@@ -153,7 +153,10 @@ const mutations = {
updateContactAddressbook(state, { contact, addressbook }) {
if (state.contacts[contact.key] && contact instanceof Contact) {
// replace contact object data
- state.contacts[contact.key].updateAddressbook(addressbook)
+ let oldKey = contact.key
+ let newContact = new Contact(contact.dav.data, addressbook)
+ Vue.set(state.contacts, newContact.key, newContact)
+ Vue.delete(state.contacts, oldKey)
} else {
console.error('Error while replacing the addressbook of following contact', contact)