mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
[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:
@@ -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;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user