[WIP] Client/multiple fixes shops (#8956)

* reposition FlyingPigs and Hydra

* hide count-badge if 0

* fix sortBy hatchable (ignore already hatched pets)

* always show animal name

* featuredItems, use shopItem objects

* fix egg / potion names in market

* buyModals: check for price, mark it if not enough available / change buy-button opacity / show purchaseGems button

* save itemRows open/collapsed state during session, refactor itemRows for some more performance

* pin featured items

* show bordered items in market buyModal

* fix popover margins / paddings

* position pinned items popovers to the left
This commit is contained in:
negue
2017-08-17 00:34:25 +02:00
committed by Keith Holliday
parent 88e6cf7d8a
commit f5cf27a79e
18 changed files with 302 additions and 73 deletions

View File

@@ -59,6 +59,14 @@
h4.popover-content-title {{ item.text }}
.popover-content-text(v-html="item.notes")
template(slot="itemBadge", scope="ctx")
span.badge.badge-pill.badge-item.badge-svg(
:class="{'item-selected-badge': ctx.item.pinned, 'hide': !ctx.item.pinned}",
@click.prevent.stop="togglePinned(ctx.item)"
)
span.svg-icon.inline.icon-12.color(v-html="icons.pin")
h1.mb-0.page-header(v-once) {{ $t('quests') }}
.clearfix
@@ -84,6 +92,7 @@
:items="questItems(category, selectedSortItemsBy, searchTextThrottled, hideLocked, hidePinned)",
:itemWidth=94,
:itemMargin=24,
:type="'pet_quests'",
)
template(slot="item", scope="ctx")
shopItem(
@@ -338,6 +347,7 @@
import _throttle from 'lodash/throttle';
import _groupBy from 'lodash/groupBy';
import _map from 'lodash/map';
import _get from 'lodash/get';
export default {
components: {
@@ -403,7 +413,10 @@ export default {
featuredItems () {
return featuredItems.quests.map(i => {
return getItemInfo(this.user, 'quest', this.content.quests[i]);
let newItem = getItemInfo(this.user, i.type, _get(this.content, i.path));
newItem.pinned = _isPinned(this.user, newItem);
return newItem;
});
},
},