Fix repo search

This commit is contained in:
Piotr Sarnacki 2015-12-07 17:48:33 +01:00
parent ada9e9ba02
commit 00653e9420
3 changed files with 10 additions and 6 deletions

View File

@ -148,7 +148,9 @@ Repo.reopenClass
result.pushObjects(promise.get('content').toArray())
result.set('isLoaded', true)
result
result
promise
withLastBuild: (store) ->
repos = store.filter('repo', {}, (build) ->

View File

@ -11,9 +11,7 @@ Route = TravisRoute.extend
@controllerFor('repo').activate('index')
@controllerFor('repos').activate(@get('reposTabName'))
@currentRepoDidChange()
if repos = @controllerFor('repos')
repos.addObserver('repos.firstObject', this, 'currentRepoDidChange')
@setCurrentRepoObservers()
deactivate: ->
if repos = @controllerFor('repos')
@ -25,6 +23,11 @@ Route = TravisRoute.extend
if repo = @controllerFor('repos').get('repos.firstObject')
@controllerFor('repo').set('repo', repo)
setCurrentRepoObservers: ->
@currentRepoDidChange()
if repos = @controllerFor('repos')
repos.addObserver('repos.firstObject', this, 'currentRepoDidChange')
actions:
redirectToGettingStarted: ->
@transitionTo('getting_started')

View File

@ -10,8 +10,7 @@ Route = MainTabRoute.extend
@controllerFor('repo').activate('index')
@controllerFor('repos').activate('search', searchPhrase)
@currentRepoDidChange()
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
@setCurrentRepoObservers()
model: (params) ->
params.phrase.replace(/%2F/g, '/')