From 6a47ba78297de6f98f604b184d713a333b4a569e Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Nov 2022 14:29:16 +0100 Subject: [PATCH] close all open collapse by change tabs in community --- .../components/Contributions/ContributionListItem.vue | 2 ++ frontend/src/pages/Community.vue | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index 683d234ba..82b796e33 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -54,6 +54,7 @@ v-b-toggle="collapsId" icon="chat-dots" class="h2 mr-5" + @mousedown="$root.$emit('close-all-open-collapse')" @click="getListContributionMessages" > @@ -64,6 +65,7 @@ v-if="state === 'IN_PROGRESS'" v-b-toggle="collapsId" variant="warning" + @mousedown="$root.$emit('close-all-open-collapse')" @click="getListContributionMessages" > {{ $t('contribution.alert.answerQuestion') }} diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 786307405..28d3bdabf 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -49,7 +49,7 @@ :pageSize="pageSize" /> - +

{{ $t('navigation.community') }}

@@ -70,6 +70,7 @@ :items="itemsAll" @update-list-contributions="updateListAllContributions" @update-contribution-form="updateContributionForm" + @close-all-open-collapse="closeAllOpenCollapse" :contributionCount="contributionCountAll" :showPagination="true" :pageSize="pageSizeAll" @@ -112,6 +113,13 @@ export default { } }, methods: { + closeAllOpenCollapse() { + // console.log('Community closeAllOpenCollapse ') + // console.log('closeAllOpenCollapse', this.$el.querySelectorAll('.collapse.show')) + this.$el.querySelectorAll('.collapse.show').forEach((value) => { + this.$root.$emit('bv::toggle::collapse', value.id) + }) + }, setContribution(data) { this.$apollo .mutate({