Home button on ladder level goes to ladder.

This commit is contained in:
Nick Winter 2014-02-26 18:58:25 -08:00
parent 4e8c0b65e2
commit c26995a3a9
2 changed files with 12 additions and 7 deletions

View file

@ -1,6 +1,6 @@
h4.home
a(href="/")
a(href=homeLink || "/")
i.icon-home.icon-white
span(data-i18n="play_level.home") Home

View file

@ -47,12 +47,17 @@ module.exports = class ControlBarView extends View
text += " (#{numPlayers})" if numPlayers > 1
$('#multiplayer-button', @$el).text(text)
getRenderData: (context={}) ->
super context
context.worldName = @worldName
context.multiplayerEnabled = @session.get('multiplayer')
context.ladderGame = @ladderGame
context
getRenderData: (c={}) ->
super c
c.worldName = @worldName
c.multiplayerEnabled = @session.get('multiplayer')
c.ladderGame = @ladderGame
c.homeLink = "/"
levelID = @level.get('slug')
if levelID in ["project-dota", "brawlwood", "ladder-tutorial"]
levelID = 'project-dota' if levelID is 'ladder-tutorial'
c.homeLink = "/play/ladder/" + levelID
c
showGuideModal: ->
options = {docs: @level.get('documentation'), supermodel: @supermodel}