Added a way to set titles for RootViews. In development, titles show what RootView class you're looking at.
This commit is contained in:
parent
d65ade7a97
commit
3305a3d7db
2 changed files with 11 additions and 0 deletions
app/views
|
@ -60,6 +60,8 @@ module.exports = class LevelEditView extends RootView
|
|||
$el ?= @$el.find('.outer-content')
|
||||
super($el)
|
||||
|
||||
getTitle: -> "LevelEditor - " + (@level.get('name') or '...')
|
||||
|
||||
onLoaded: ->
|
||||
_.defer =>
|
||||
@world = @levelLoader.world
|
||||
|
|
|
@ -78,6 +78,15 @@ module.exports = class RootView extends CocoView
|
|||
@buildLanguages()
|
||||
$('body').removeClass('is-playing')
|
||||
|
||||
if application.isProduction()
|
||||
title = 'CodeCombat - ' + (@getTitle() or 'Learn how to code by playing a game')
|
||||
else
|
||||
title = @getTitle() or @constructor.name
|
||||
|
||||
$('title').text(title)
|
||||
|
||||
getTitle: -> ''
|
||||
|
||||
chooseTab: (category) ->
|
||||
$("a[href='##{category}']", @$el).tab('show')
|
||||
|
||||
|
|
Reference in a new issue