diff options
-rw-r--r-- | css/ContactDetails.scss | 17 | ||||
-rw-r--r-- | src/components/ContactDetails.vue | 6 | ||||
-rw-r--r-- | src/components/ContactDetails/ContactDetailsAvatar.vue | 6 | ||||
-rw-r--r-- | src/store/contacts.js | 5 |
4 files changed, 20 insertions, 14 deletions
diff --git a/css/ContactDetails.scss b/css/ContactDetails.scss index 07948d3b..a141c52a 100644 --- a/css/ContactDetails.scss +++ b/css/ContactDetails.scss @@ -77,13 +77,16 @@ width: 16px; height: 16px; } - } - [class^='icon-'], - [class*=' icon-'] { - height: 44px; - width: 44px; - padding: 14px; - cursor: pointer; + + &[class^='icon-'], + &[class*=' icon-'], + > [class^='icon-'], + > [class*=' icon-'] { + height: 44px; + width: 44px; + padding: 14px; + cursor: pointer; + } } } } 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) |