diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 9ea8c2a7..69d3999c 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -55,7 +55,8 @@ const UserProfile = { followsTab: 'users', footerRef: null, note: null, - noteLoading: false + noteLoading: false, + expandedFields: [] } }, created () { @@ -195,7 +196,14 @@ const UserProfile = { debounceSetNote: debounce(function () { this.$store.dispatch('setNote', { id: this.userId, note: this.note }) this.noteLoading = false - }, 1500) + }, 1500), + toggleFieldWrap (index) { + if (this.expandedFields[index]) { + this.expandedFields[index] = false + } else { + this.expandedFields[index] = true + } + } }, watch: { '$route.params.id': function (newVal) { diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index c4547545..381ff6d3 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -25,6 +25,10 @@ v-for="(field, index) in user.fields_html" :key="index" class="user-profile-field" + :class="{ + 'field-expanded': expandedFields[index] + }" + @click="toggleFieldWrap(index)" >