mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
refactor(pets): render mounts server-side for better perf
This commit is contained in:
parent
81b7eed8ca
commit
df1867ef4d
1 changed files with 10 additions and 7 deletions
|
|
@ -13,13 +13,16 @@ script(type='text/ng-template', id='partials/options.inventory.mounts.html')
|
|||
h4= '{{Shared.countMounts(null,User.user.items.mounts) || 0}} / {{totalMounts}} ' + env.t('mountsTamed')
|
||||
.col-md-12
|
||||
menu.pets(type='list')
|
||||
li.customize-menu(ng-repeat='egg in Content.eggs')
|
||||
menu
|
||||
div(ng-repeat='potion in Content.hatchingPotions', popover-trigger='mouseenter', popover=env.t('mountName', {potion: '{{potion.text()}}', mount: '{{egg.mountText()}}'}), popover-placement='bottom', ng-init='mount = egg.key+"-"+potion.key')
|
||||
button(class="pet-button Mount_Head_{{mount}}", ng-show='user.items.mounts[mount]', ng-class='{active: user.items.currentMount == mount}', ng-click='chooseMount(egg.key, potion.key)')
|
||||
//div(class='Mount_Head_{{mount}}')
|
||||
button(class="pet-button pet-not-owned", ng-hide='user.items.mounts[mount]')
|
||||
.PixelPaw
|
||||
each egg in env.Content.eggs
|
||||
li.customize-menu
|
||||
menu
|
||||
each potion in env.Content.hatchingPotions
|
||||
- mount = egg.key+"-"+potion.key
|
||||
div(popover-trigger='mouseenter', popover=env.t('mountName', {potion: potion.text(), mount: egg.mountText()}), popover-placement='bottom')
|
||||
button(class="pet-button Mount_Head_#{mount}", ng-show='user.items.mounts["#{mount}"]', ng-class='{active: user.items.currentMount == "#{mount}"', ng-click='chooseMount("#{egg.key}", "#{potion.key}")')
|
||||
//div(class='Mount_Head_{{mount}}')
|
||||
button(class="pet-button pet-not-owned", ng-hide='user.items.mounts["#{mount}"]')
|
||||
.PixelPaw
|
||||
.col-md-12
|
||||
h4=env.t('rareMounts')
|
||||
menu
|
||||
|
|
|
|||
Loading…
Reference in a new issue