mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
add change showFilter by mouseleave on my-filter
This commit is contained in:
parent
e8ce152f06
commit
df22c7289e
@ -6,7 +6,7 @@
|
||||
:filled="!filteredCategoryIds.length"
|
||||
:label="$t('filter-menu.all')"
|
||||
icon="check"
|
||||
@click="resetCategories"
|
||||
@click="setResetCategories"
|
||||
/>
|
||||
</li>
|
||||
<li class="item item-save-topics">
|
||||
@ -62,6 +62,10 @@ export default {
|
||||
resetCategories: 'posts/RESET_CATEGORIES',
|
||||
toggleCategory: 'posts/TOGGLE_CATEGORY',
|
||||
}),
|
||||
setResetCategories() {
|
||||
this.resetCategories()
|
||||
this.$emit('showFilterMenu')
|
||||
},
|
||||
saveCategories() {
|
||||
this.$apollo
|
||||
.mutate({
|
||||
@ -69,6 +73,7 @@ export default {
|
||||
variables: { activeCategories: this.filteredCategoryIds },
|
||||
})
|
||||
.then(() => {
|
||||
this.$emit('showFilterMenu')
|
||||
this.$toast.success(this.$t('filter-menu.save.success'))
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="filter-menu-options">
|
||||
<h2 class="title">{{ $t('filter-menu.filter-by') }}</h2>
|
||||
<following-filter />
|
||||
<categories-filter v-if="categoriesActive" />
|
||||
<categories-filter v-if="categoriesActive" @showFilterMenu="$emit('showFilterMenu')" />
|
||||
</div>
|
||||
<div class="filter-menu-options">
|
||||
<h2 class="title">{{ $t('filter-menu.order-by') }}</h2>
|
||||
|
||||
@ -179,7 +179,9 @@
|
||||
style="text-align: center"
|
||||
>
|
||||
<client-only>
|
||||
<group-button />
|
||||
<div @click="toggleMobileMenuView">
|
||||
<group-button />
|
||||
</div>
|
||||
</client-only>
|
||||
</ds-flex-item>
|
||||
<!-- map button -->
|
||||
|
||||
@ -66,7 +66,9 @@
|
||||
</span>
|
||||
|
||||
<div id="my-filter" v-if="showFilter">
|
||||
<filter-menu-component />
|
||||
<div @mouseleave="showFilter = false">
|
||||
<filter-menu-component @showFilterMenu="showFilterMenu" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -203,7 +205,7 @@ export default {
|
||||
toggleCategory: 'posts/TOGGLE_CATEGORY',
|
||||
}),
|
||||
showFilterMenu(e) {
|
||||
if (!e.target.closest('#my-filter') && !e.target.closest('.my-filter-button')) {
|
||||
if (!e || (!e.target.closest('#my-filter') && !e.target.closest('.my-filter-button'))) {
|
||||
if (!this.showFilter) return
|
||||
this.showFilter = false
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user