mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-16 00:19:50 -05:00
Fixed the gold view not showing numbers until the first change.
This commit is contained in:
parent
2a309c149c
commit
61e6c8dfc3
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ module.exports = class GoldView extends View
|
|||
@teamGold = {}
|
||||
@teamGoldEarned = {}
|
||||
@shownOnce = false
|
||||
|
||||
|
||||
onGoldChanged: (e) ->
|
||||
return if @teamGold[e.team] is e.gold and @teamGoldEarned[e.team] is e.goldEarned
|
||||
@teamGold[e.team] = e.gold
|
||||
|
@ -24,7 +24,7 @@ module.exports = class GoldView extends View
|
|||
unless goldEl.length
|
||||
teamEl = teamTemplate team: e.team
|
||||
@$el[if e.team is 'humans' then 'prepend' else 'append'](teamEl)
|
||||
goldEl = $('.gold-amount.team-' + e.team, teamEl)
|
||||
goldEl = @$el.find('.gold-amount.team-' + e.team)
|
||||
text = '' + e.gold
|
||||
if e.goldEarned and e.goldEarned > e.gold
|
||||
text += " (#{e.goldEarned})"
|
||||
|
|
Loading…
Reference in a new issue