Fix settings tab highlighting

This commit is contained in:
Piotr Sarnacki 2014-08-06 16:38:37 +02:00
parent b4dc5ec547
commit 2958717eba
2 changed files with 3 additions and 15 deletions

View File

@ -57,7 +57,7 @@ Travis.RepoController = Travis.Controller.extend
@connectTab('request')
viewSettings: ->
@connectTab('request')
@connectTab('settings')
lastBuildDidChange: ->
Ember.run.scheduleOnce('data', this, @_lastBuildDidChange);

View File

@ -341,21 +341,9 @@ Travis.AuthRoute = Travis.Route.extend
@transitionTo('index.current')
return true
Travis.RepoSettingsRoute = Travis.Route.extend
Travis.SettingsRoute = Travis.Route.extend
setupController: (controller, model) ->
# TODO: if repo is just a data hash with id and slug load it
# as incomplete record
model = Travis.Repo.find(model.id) if model && !model.get
@_super(controller, model)
serialize: (repo) ->
slug = if repo.get then repo.get('slug') else repo.slug
[owner, name] = slug.split('/')
{ owner: owner, name: name }
model: (params) ->
slug = "#{params.owner}/#{params.name}"
Travis.Repo.fetchBySlug(slug)
@controllerFor('repo').activate('settings')
Travis.SettingsIndexRoute = Travis.Route.extend
model: ->