Queue log appending if record is not loaded yet
This commit is contained in:
parent
fd6a83aab1
commit
4a16f7a142
|
@ -2,6 +2,19 @@ require 'travis/model'
|
||||||
|
|
||||||
@Travis.Artifact = Travis.Model.extend
|
@Travis.Artifact = Travis.Model.extend
|
||||||
body: DS.attr('string')
|
body: DS.attr('string')
|
||||||
|
init: ->
|
||||||
|
@_super.apply this, arguments
|
||||||
|
@set 'queue', Ember.A([])
|
||||||
|
|
||||||
append: (body) ->
|
append: (body) ->
|
||||||
|
if @get('isLoaded')
|
||||||
@set('body', @get('body') + body)
|
@set('body', @get('body') + body)
|
||||||
|
else
|
||||||
|
@get('queue').pushObject(body)
|
||||||
|
|
||||||
|
recordDidLoad: (->
|
||||||
|
if @get('isLoaded')
|
||||||
|
queue = @get('queue')
|
||||||
|
if queue.get('length') > 0
|
||||||
|
@append queue.toArray().join('')
|
||||||
|
).observes('isLoaded')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user