From aa2949e9d1fc62de8d9b82e8f74b5bb7ad3d9fb7 Mon Sep 17 00:00:00 2001 From: negue Date: Mon, 4 Mar 2019 19:54:23 +0100 Subject: [PATCH] shops - quest: refactor filter logic + quest items margins --- website/client/components/shops/quests/index.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/website/client/components/shops/quests/index.vue b/website/client/components/shops/quests/index.vue index 7194137872..8409e26b1b 100644 --- a/website/client/components/shops/quests/index.vue +++ b/website/client/components/shops/quests/index.vue @@ -81,7 +81,7 @@ div( v-for="category in categories", - v-if="viewOptions[category.identifier].selected" + v-if="!anyFilterSelected || viewOptions[category.identifier].selected" ) h2.mb-3 {{ category.text }} @@ -250,6 +250,7 @@ background-color: #edecee; display: inline-block; padding: 8px; + margin-right: 12px; } .item-wrapper { @@ -258,6 +259,7 @@ .items > div:not(:last-of-type) { margin-right: 16px; + margin-bottom: 16px; } } @@ -415,7 +417,7 @@ export default { if (this.shop.categories) { this.shop.categories.map((category) => { this.$set(this.viewOptions, category.identifier, { - selected: true, + selected: false, }); }); @@ -424,6 +426,10 @@ export default { return []; } }, + + anyFilterSelected () { + return Object.values(this.viewOptions).some(g => g.selected); + }, }, methods: { questItems (category, sortBy, searchBy, hideLocked, hidePinned) {