travis-web/assets/scripts/app/routes/main-tab.coffee
2015-01-29 13:39:06 +01:00

31 lines
780 B
CoffeeScript

require 'routes/route'
TravisRoute = Travis.Route
Route = TravisRoute.extend
renderTemplate: ->
@render 'repo'
@render 'build', into: 'repo'
setupController: ->
@_super.apply this, arguments
@controllerFor('repo').activate('index')
@controllerFor('repos').activate(@get('reposTabName'))
@currentRepoDidChange()
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
deactivate: ->
@controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange')
currentRepoDidChange: ->
if repo = @controllerFor('repos').get('firstObject')
@controllerFor('repo').set('repo', repo)
actions:
redirectToGettingStarted: ->
@transitionTo('getting_started')
Travis.MainTabRoute = Route