restore isLoaded for repos controller
This commit is contained in:
parent
38e8a2a8e1
commit
d94b001e81
|
@ -3,6 +3,7 @@ require 'travis/limited_array'
|
|||
Travis.ReposController = Ember.ArrayController.extend
|
||||
defaultTab: 'recent'
|
||||
sortProperties: ['sortOrder']
|
||||
isLoadedBinding: 'content.isLoaded'
|
||||
|
||||
init: ->
|
||||
@activate(@defaultTab)
|
||||
|
@ -22,8 +23,8 @@ Travis.ReposController = Ember.ArrayController.extend
|
|||
content = Travis.LimitedArray.create
|
||||
content: Travis.Repo.find()
|
||||
limit: 30
|
||||
|
||||
@set('content', content)
|
||||
# @set('content', Travis.Repo.find())
|
||||
|
||||
viewOwned: ->
|
||||
@set('content', Travis.Repo.accessibleBy(Travis.app.get('currentUser.login')))
|
||||
|
|
|
@ -28,6 +28,12 @@ Travis.Store = DS.Store.extend
|
|||
|
||||
result
|
||||
|
||||
# TODO use isUpdating once we've upgraded ember-data
|
||||
loadMany: (type, ids, hashes) ->
|
||||
result = @_super.apply this, arguments
|
||||
array.set('isLoaded', true) for array in @typeMapFor(type).recordArrays
|
||||
result
|
||||
|
||||
merge: (type, id, hash) ->
|
||||
if hash == undefined
|
||||
hash = id
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
'loading' unless @get('repo.isLoaded')
|
||||
).property('repo.isLoaded')
|
||||
|
||||
isEmpty: (->
|
||||
@get('repos.isLoaded') && @get('repos.length') == 0
|
||||
).property('repos.length')
|
||||
|
||||
urlGithub: (->
|
||||
Travis.Urls.githubRepo(@get('repo.slug'))
|
||||
).property('repo.slug'),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
Travis.LimitedArray = Em.ArrayProxy.extend
|
||||
limit: 10
|
||||
isLoadedBinding: 'content.isLoaded'
|
||||
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
|
@ -11,7 +12,6 @@ Travis.LimitedArray = Em.ArrayProxy.extend
|
|||
|
||||
contentArrayDidChange: (array, index, removedCount, addedCount) ->
|
||||
@_super.apply this, arguments
|
||||
|
||||
if addedCount > 0
|
||||
addedObjects = array.slice(index, index + addedCount)
|
||||
arrangedContent = @get('arrangedContent')
|
||||
|
|
Loading…
Reference in New Issue
Block a user