mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
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
|
@ -59,6 +59,8 @@ module.exports = class LevelEditView extends RootView
|
|||
showLoading: ($el) ->
|
||||
$el ?= @$el.find('.outer-content')
|
||||
super($el)
|
||||
|
||||
getTitle: -> "LevelEditor - " + (@level.get('name') or '...')
|
||||
|
||||
onLoaded: ->
|
||||
_.defer =>
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue