mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
* change quest banner backgrond * itemRows in inventory * use itemRows in inventory/items - showLess/showMore as default labels - extend white space if theres no button available * hide popover if dragging is active - show dragging info on first click (without to move) * use itemRows in inventory/stable * fix some strings * highlight currently dragging item in inventory/items - auto attach info on click - z-index * fix shopItem label color * fix floating npcs in banner * hatched-pet-dialog in items / stable * change all ctx to context
64 lines
1.1 KiB
Vue
64 lines
1.1 KiB
Vue
<template lang="pug">
|
|
div(v-if="emptyItem")
|
|
.item-wrapper
|
|
.item.item-empty
|
|
.item-content
|
|
span.item-label(v-if="label") {{ label }}
|
|
b-popover(
|
|
v-else,
|
|
:triggers="[showPopover?'hover':'']",
|
|
:placement="popoverPosition",
|
|
)
|
|
span(slot="content")
|
|
slot(name="popoverContent", :item="item")
|
|
|
|
.item-wrapper(@click="click")
|
|
.item(:class="{'item-active': active }")
|
|
slot(name="itemBadge", :item="item")
|
|
span.item-content(
|
|
:class="itemContentClass"
|
|
)
|
|
span.item-label(v-if="label") {{ label }}
|
|
</template>
|
|
|
|
<script>
|
|
import bPopover from 'bootstrap-vue/lib/components/popover';
|
|
|
|
export default {
|
|
components: {
|
|
bPopover,
|
|
},
|
|
props: {
|
|
item: {
|
|
type: Object,
|
|
},
|
|
itemContentClass: {
|
|
type: String,
|
|
},
|
|
label: {
|
|
type: String,
|
|
},
|
|
emptyItem: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
popoverPosition: {
|
|
type: String,
|
|
default: 'bottom',
|
|
},
|
|
showPopover: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
active: {
|
|
type: Boolean,
|
|
},
|
|
},
|
|
methods: {
|
|
click () {
|
|
this.$emit('click', this.item);
|
|
},
|
|
},
|
|
};
|
|
</script>
|