shops - quest: refactor filter logic + quest items margins

This commit is contained in:
negue
2019-03-04 19:54:23 +01:00
parent ad62b7a358
commit aa2949e9d1

View File

@@ -81,7 +81,7 @@
div( div(
v-for="category in categories", v-for="category in categories",
v-if="viewOptions[category.identifier].selected" v-if="!anyFilterSelected || viewOptions[category.identifier].selected"
) )
h2.mb-3 {{ category.text }} h2.mb-3 {{ category.text }}
@@ -250,6 +250,7 @@
background-color: #edecee; background-color: #edecee;
display: inline-block; display: inline-block;
padding: 8px; padding: 8px;
margin-right: 12px;
} }
.item-wrapper { .item-wrapper {
@@ -258,6 +259,7 @@
.items > div:not(:last-of-type) { .items > div:not(:last-of-type) {
margin-right: 16px; margin-right: 16px;
margin-bottom: 16px;
} }
} }
@@ -415,7 +417,7 @@ export default {
if (this.shop.categories) { if (this.shop.categories) {
this.shop.categories.map((category) => { this.shop.categories.map((category) => {
this.$set(this.viewOptions, category.identifier, { this.$set(this.viewOptions, category.identifier, {
selected: true, selected: false,
}); });
}); });
@@ -424,6 +426,10 @@ export default {
return []; return [];
} }
}, },
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
}, },
methods: { methods: {
questItems (category, sortBy, searchBy, hideLocked, hidePinned) { questItems (category, sortBy, searchBy, hideLocked, hidePinned) {