mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 01:29:21 +00:00
Highlight active pet
This commit is contained in:
parent
419351494c
commit
6d34fa8953
3 changed files with 7 additions and 2 deletions
|
|
@ -28,6 +28,7 @@ module.exports.app = (appExports, model) ->
|
|||
petStr = "#{text}-#{modifier}"
|
||||
pet = _.findWhere pets, text: text
|
||||
pet.modifier = modifier
|
||||
pet.str = petStr
|
||||
ownsThisPet = user.get('items.pets').indexOf petStr
|
||||
if ownsThisPet != -1
|
||||
user.set 'items.currentPet', pet
|
||||
|
|
|
|||
|
|
@ -20,4 +20,8 @@
|
|||
|
||||
|
||||
.character-sprites span
|
||||
position: absolute
|
||||
position: absolute
|
||||
|
||||
#profileStable
|
||||
.active
|
||||
border 1px solid black
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@
|
|||
<p>You don't have any pets yet.</p>
|
||||
{/if}
|
||||
{#each _user.items.pets as :pet}
|
||||
<div class="Pet-{removeWhitespace(:pet)}" data-pet="{:pet}" x-bind="click:choosePet">{:pet}</div>
|
||||
<div class="Pet-{:pet} {#if equal(_user.items.currentPet.str, :pet)}active{/if}" data-pet="{:pet}" x-bind="click:choosePet">{:pet}</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue