Fix selected class on repos list
This commit is contained in:
parent
f1a767a09f
commit
0f89da6dea
|
@ -3,8 +3,14 @@ require 'travis/limited_array'
|
||||||
Travis.ReposController = Ember.ArrayController.extend
|
Travis.ReposController = Ember.ArrayController.extend
|
||||||
defaultTab: 'recent'
|
defaultTab: 'recent'
|
||||||
isLoadedBinding: 'content.isLoaded'
|
isLoadedBinding: 'content.isLoaded'
|
||||||
needs: ['currentUser']
|
needs: ['currentUser', 'repo']
|
||||||
currentUserBinding: 'controllers.currentUser'
|
currentUserBinding: 'controllers.currentUser'
|
||||||
|
selectedRepo: (->
|
||||||
|
# we need to observe also repo.content here, because we use
|
||||||
|
# ObjectProxy in repo controller
|
||||||
|
# TODO: get rid of ObjectProxy there
|
||||||
|
@get('controllers.repo.repo.content') || @get('controllers.repo.repo')
|
||||||
|
).property('controllers.repo.repo', 'controllers.repo.repo.content')
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
Ember.run.later(@updateTimes.bind(this), Travis.INTERVALS.updateTimes)
|
Ember.run.later(@updateTimes.bind(this), Travis.INTERVALS.updateTimes)
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
repoBinding: 'content'
|
repoBinding: 'content'
|
||||||
classNames: ['repo']
|
classNames: ['repo']
|
||||||
classNameBindings: ['color', 'selected']
|
classNameBindings: ['color', 'selected']
|
||||||
selectedBinding: 'repo.selected'
|
selected: (->
|
||||||
|
@get('content') == @get('controller.selectedRepo')
|
||||||
|
).property('controller.selectedRepo')
|
||||||
|
|
||||||
color: (->
|
color: (->
|
||||||
Travis.Helpers.colorForState(@get('repo.lastBuildState'))
|
Travis.Helpers.colorForState(@get('repo.lastBuildState'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user