mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
Fixed the title in the gold view to handle when goldEarned isn't available.
This commit is contained in:
parent
49c8360d5b
commit
1263d4724a
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue