mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
filters colored which were selected by filter
This commit is contained in:
parent
3dfcf4df9f
commit
11e992aa1d
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<ds-tag class="category-tag">
|
<ds-tag class="category-tag" :class="filterActive ? 'filterActive' : ''">
|
||||||
<base-icon :name="icon" />
|
<base-icon :name="icon" />
|
||||||
{{ name }}
|
{{ name }}
|
||||||
</ds-tag>
|
</ds-tag>
|
||||||
@ -11,6 +11,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
icon: { type: String, required: true },
|
icon: { type: String, required: true },
|
||||||
name: { type: String, default: '' },
|
name: { type: String, default: '' },
|
||||||
|
filterActive: { type: Boolean, default: false, required: false },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -28,4 +29,7 @@ export default {
|
|||||||
font-size: $font-size-base;
|
font-size: $font-size-base;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.filterActive{
|
||||||
|
background-color: $color-success-active;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
placement: 'bottom-start',
|
placement: 'bottom-start',
|
||||||
}"
|
}"
|
||||||
:icon="category.icon"
|
:icon="category.icon"
|
||||||
|
:filterActive="postsFilter ? postsFilter.id_in.includes(category.id) : false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="categories-placeholder"></div>
|
<div v-else class="categories-placeholder"></div>
|
||||||
@ -107,6 +108,10 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
|
postsFilter: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -93,6 +93,7 @@
|
|||||||
>
|
>
|
||||||
<post-teaser
|
<post-teaser
|
||||||
:post="post"
|
:post="post"
|
||||||
|
:postsFilter="postsFilter['categories_some']"
|
||||||
@removePostFromList="posts = removePostFromList(post, posts)"
|
@removePostFromList="posts = removePostFromList(post, posts)"
|
||||||
@pinPost="pinPost(post, refetchPostList)"
|
@pinPost="pinPost(post, refetchPostList)"
|
||||||
@unpinPost="unpinPost(post, refetchPostList)"
|
@unpinPost="unpinPost(post, refetchPostList)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user