mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
21 lines
659 B
Text
21 lines
659 B
Text
|
mixin heroOption(hero)
|
||
|
- var heroOriginal = hero.get('original')
|
||
|
- var selectedState
|
||
|
if state.get('selectedHeroOriginal') === heroOriginal
|
||
|
- selectedState = 'selected'
|
||
|
else if view.options.showCurrentHero && state.get('currentHeroOriginal') === heroOriginal
|
||
|
- selectedState = 'current'
|
||
|
else
|
||
|
- selectedState = ''
|
||
|
.hero-option(data-hero-original=heroOriginal, class=selectedState)
|
||
|
.hero-avatar
|
||
|
img(src=hero.getPortraitURL())
|
||
|
.text-h5.hero-name
|
||
|
span= hero.getHeroShortName()
|
||
|
|
||
|
.hero-list
|
||
|
if view.heroes.loaded
|
||
|
each hero in view.heroes.models
|
||
|
if hero.get('heroClass') === 'Warrior'
|
||
|
+heroOption(hero)
|