Highlight active pet

This commit is contained in:
Daniel Saewitz 2013-03-16 15:09:16 -04:00
parent 419351494c
commit 6d34fa8953
3 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -21,3 +21,7 @@
.character-sprites span
position: absolute
#profileStable
.active
border 1px solid black

View file

@ -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>