diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-08-13 19:09:52 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-08-13 19:09:52 +0200 |
commit | aab3a24bd592ef451a5fdcfb8d90068dd12cf621 (patch) | |
tree | 53a961d5ef642243bef5a34ae33a8a8e4b702e66 /src | |
parent | c1f54a232c912656312080962ae4bd7b5d4a53cc (diff) |
Design grid fixes, delete and flex
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/properties/PropertyDateTime.vue | 20 | ||||
-rw-r--r-- | src/components/properties/PropertyMultipleText.vue | 22 | ||||
-rw-r--r-- | src/components/properties/PropertyText.vue | 20 |
3 files changed, 35 insertions, 27 deletions
diff --git a/src/components/properties/PropertyDateTime.vue b/src/components/properties/PropertyDateTime.vue index 84bf767d..210efa34 100644 --- a/src/components/properties/PropertyDateTime.vue +++ b/src/components/properties/PropertyDateTime.vue @@ -22,18 +22,20 @@ <template> <div v-if="propModel" class="contact-details-property grid-span-1"> - <!-- type selector --> - <multiselect v-if="propModel.options" v-model="selectType" - :options="propModel.options" :searchable="false" :placeholder="t('contacts', 'Select type')" - class="multiselect-vue contact-details-label" track-by="id" label="name" /> + <div class="contact-details-property-row"> + <!-- type selector --> + <multiselect v-if="propModel.options" v-model="selectType" + :options="propModel.options" :searchable="false" :placeholder="t('contacts', 'Select type')" + class="multiselect-vue contact-details-label" track-by="id" label="name" /> - <!-- if we do not support any type on our model but one is set anyway --> - <div v-else-if="selectType" class="contact-details-label">{{ selectType.name }}</div> + <!-- if we do not support any type on our model but one is set anyway --> + <div v-else-if="selectType" class="contact-details-label">{{ selectType.name }}</div> - <!-- delete the prop --> - <button :title="t('contacts', 'Delete')" class="icon-delete" @click="deleteProperty" /> + <!-- delete the prop --> + <button :title="t('contacts', 'Delete')" class="icon-delete" @click="deleteProperty" /> - <input v-model="value" type="text"> + <input v-model="value" type="text"> + </div> </div> </template> diff --git a/src/components/properties/PropertyMultipleText.vue b/src/components/properties/PropertyMultipleText.vue index 5ed6f32e..b49ef61f 100644 --- a/src/components/properties/PropertyMultipleText.vue +++ b/src/components/properties/PropertyMultipleText.vue @@ -22,16 +22,18 @@ <template> <div v-if="propModel" :class="`grid-span-${gridLength}`" class="contact-details-property"> - <!-- type selector --> - <multiselect v-if="propModel.options" v-model="selectType" - :options="propModel.options" :searchable="false" :placeholder="t('contacts', 'Select type')" - class="multiselect-vue contact-details-label" track-by="id" label="name" /> + <div class="contact-details-property-row"> + <!-- type selector --> + <multiselect v-if="propModel.options" v-model="selectType" + :options="propModel.options" :searchable="false" :placeholder="t('contacts', 'Select type')" + class="multiselect-vue contact-details-label" track-by="id" label="name" /> - <!-- if we do not support any type on our model but one is set anyway --> - <div v-else-if="selectType" class="contact-details-label">{{ selectType.name }}</div> + <!-- if we do not support any type on our model but one is set anyway --> + <div v-else-if="selectType" class="contact-details-label">{{ selectType.name }}</div> - <!-- delete the prop --> - <button :title="t('contacts', 'Delete')" class="icon-delete" @click="deleteProperty" /> + <!-- delete the prop --> + <button :title="t('contacts', 'Delete')" class="icon-delete" @click="deleteProperty" /> + </div> <div v-for="index in propModel.displayOrder" :key="index" class="contact-details-property-row"> <div class="contact-details-label">{{ propModel.readableValues[index] }}</div> @@ -67,7 +69,9 @@ export default { computed: { gridLength() { - return this.propModel.displayOrder ? this.propModel.displayOrder.length : this.value.length + let hasType = this.propModel.options || this.selectType + let length = this.propModel.displayOrder ? this.propModel.displayOrder.length : this.value.length + return hasType ? length + 1 : length } }, diff --git a/src/components/properties/PropertyText.vue b/src/components/properties/PropertyText.vue index 78baa7a8..df490c67 100644 --- a/src/components/properties/PropertyText.vue +++ b/src/components/properties/PropertyText.vue @@ -22,18 +22,20 @@ <template> <div v-if="propModel" class="contact-details-property grid-span-1"> - <!-- type selector --> - <multiselect v-if="propModel.options" v-model="selectType" - :options="propModel.options" :searchable="false" :placeholder="t('contacts', 'Select type')" - class="multiselect-vue contact-details-label" track-by="id" label="name" /> + <div class="contact-details-property-row"> + <!-- type selector --> + <multiselect v-if="propModel.options" v-model="selectType" + :options="propModel.options" :searchable="false" :placeholder="t('contacts', 'Select type')" + class="multiselect-vue contact-details-label" track-by="id" label="name" /> - <!-- if we do not support any type on our model but one is set anyway --> - <div v-else-if="selectType" class="contact-details-label">{{ selectType.name }}</div> + <!-- if we do not support any type on our model but one is set anyway --> + <div v-else-if="selectType" class="contact-details-label">{{ selectType.name }}</div> - <!-- delete the prop --> - <button :title="t('contacts', 'Delete')" class="icon-delete" @click="deleteProperty" /> + <!-- delete the prop --> + <button :title="t('contacts', 'Delete')" class="icon-delete" @click="deleteProperty" /> - <input v-model="value" type="text"> + <input v-model="value" type="text"> + </div> </div> </template> |