diff --git a/src/admin/components/edition/item-edition-form.vue b/src/admin/components/edition/item-edition-form.vue index eec09ccd0..364b803a5 100644 --- a/src/admin/components/edition/item-edition-form.vue +++ b/src/admin/components/edition/item-edition-form.vue @@ -268,7 +268,8 @@ v-for="(field, index) of fieldList" :key="index" :field="field" - :is-collapsed="!fieldCollapses[index]" /> + :is-collapsed="fieldCollapses[index]" + @changeCollapse="onChangeCollapse($event, index)"/> @@ -404,7 +405,7 @@ export default { this.fetchFields(this.itemId).then((fields) => { this.isLoading = false; for (let field of fields) { - this.fieldCollapses.push(false); + this.fieldCollapses.push(field.field.required == 'yes'); } }); }, @@ -560,6 +561,9 @@ export default { for (let i = 0; i < this.fieldCollapses.length; i++) this.fieldCollapses[i] = this.collapseAll; + }, + onChangeCollapse(event, index) { + this.fieldCollapses.splice(index, 1, event); } }, computed: { diff --git a/src/admin/scss/tainacan-admin.scss b/src/admin/scss/tainacan-admin.scss index 8ba4bfef6..1c2f301b4 100644 --- a/src/admin/scss/tainacan-admin.scss +++ b/src/admin/scss/tainacan-admin.scss @@ -402,6 +402,7 @@ html { input[type="checkbox"]:checked + .check { background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'%3E%3Cpath style='fill:%23000' d='M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z'%3E%3C/path%3E%3C/svg%3E") no-repeat center center; background-color: white; + border-color: $gray-light !important; } } diff --git a/src/classes/field-types/tainacan-form-item.vue b/src/classes/field-types/tainacan-form-item.vue index bdd1bfae3..23099489a 100644 --- a/src/classes/field-types/tainacan-form-item.vue +++ b/src/classes/field-types/tainacan-form-item.vue @@ -5,10 +5,10 @@ :type="fieldTypeMessage"> + @click="$emit('changeCollapse', !isCollapsed)"> + :icon="isCollapsed ? 'menu-down' : 'menu-right'" />