close all open collapse by change tabs in community

This commit is contained in:
ogerly 2022-11-14 14:29:16 +01:00
parent 7dee06bc56
commit 6a47ba7829
2 changed files with 11 additions and 1 deletions

View File

@ -54,6 +54,7 @@
v-b-toggle="collapsId"
icon="chat-dots"
class="h2 mr-5"
@mousedown="$root.$emit('close-all-open-collapse')"
@click="getListContributionMessages"
></b-icon>
</div>
@ -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') }}

View File

@ -49,7 +49,7 @@
:pageSize="pageSize"
/>
</b-tab>
<b-tab :title="$t('navigation.community')">
<b-tab :title="$t('navigation.community')" @click="closeAllOpenCollapse">
<b-alert show dismissible fade variant="secondary" class="text-dark">
<h4 class="alert-heading">{{ $t('navigation.community') }}</h4>
<p>
@ -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({