Controller#content -> Controller#model.
This commit is contained in:
parent
f9fe221e9a
commit
0972475dcb
|
@ -1,19 +1,11 @@
|
||||||
delegate = (name, options) ->
|
|
||||||
options ||= options
|
|
||||||
->
|
|
||||||
target = @get(options.to)
|
|
||||||
target[name].apply(target, arguments)
|
|
||||||
|
|
||||||
Travis.CurrentUserController = Em.ObjectController.extend
|
Travis.CurrentUserController = Em.ObjectController.extend
|
||||||
sync: ->
|
sync: ->
|
||||||
@get('content').sync()
|
@get('model').sync()
|
||||||
|
|
||||||
content: (->
|
model: Ember.computed.alias('auth.currentUser')
|
||||||
@get('auth.currentUser')
|
|
||||||
).property('auth.currentUser')
|
|
||||||
|
|
||||||
syncingDidChange: (->
|
syncingDidChange: (->
|
||||||
if (user = @get('content')) && user.get('isSyncing') && !user.get('syncedAt')
|
if (user = @get('model')) && user.get('isSyncing') && !user.get('syncedAt')
|
||||||
Ember.run.scheduleOnce 'routerTransitions', this, ->
|
Ember.run.scheduleOnce 'routerTransitions', this, ->
|
||||||
@container.lookup('router:main').send('renderFirstSync')
|
@container.lookup('router:main').send('renderFirstSync')
|
||||||
).observes('isSyncing', 'content')
|
).observes('isSyncing', 'auth.currentUser')
|
||||||
|
|
|
@ -6,13 +6,13 @@ Travis.FlashController = Ember.ArrayController.extend
|
||||||
@_super.apply this, arguments
|
@_super.apply this, arguments
|
||||||
@set('flashes', Travis.LimitedArray.create(limit: 2, content: []))
|
@set('flashes', Travis.LimitedArray.create(limit: 2, content: []))
|
||||||
|
|
||||||
content: (->
|
model: (->
|
||||||
broadcasts = @get('unseenBroadcasts')
|
broadcasts = @get('unseenBroadcasts')
|
||||||
flashes = @get('flashes')
|
flashes = @get('flashes')
|
||||||
content = []
|
model = []
|
||||||
content = content.concat(broadcasts.toArray()) if broadcasts
|
model = model.concat(broadcasts.toArray()) if broadcasts
|
||||||
content = content.concat(flashes.toArray().reverse()) if flashes
|
model = model.concat(flashes.toArray().reverse()) if flashes
|
||||||
content.uniq()
|
model.uniq()
|
||||||
).property('unseenBroadcasts.length', 'flashes.length')
|
).property('unseenBroadcasts.length', 'flashes.length')
|
||||||
|
|
||||||
unseenBroadcasts: (->
|
unseenBroadcasts: (->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user