Fixed the title in the gold view to handle when goldEarned isn't available.

This commit is contained in:
Scott Erickson 2014-07-07 16:56:47 -07:00
parent 49c8360d5b
commit 1263d4724a

View file

@ -34,7 +34,13 @@ module.exports = class GoldView extends View
@shownOnce = true
updateTitle: ->
@$el.attr 'title', ("Team '#{team}' has #{gold} now of #{@teamGoldEarned[team]} gold earned." for team, gold of @teamGold).join ' '
strings = []
for team, gold of @teamGold
if @teamGoldEarned[team]
strings.push "Team '#{team}' has #{gold} now of #{@teamGoldEarned[team]} gold earned."
else
strings.push "Team '#{team}' has #{gold} gold."
@$el.attr 'title', strings.join ' '
onSetLetterbox: (e) ->
@$el.toggle not e.on if @shownOnce