Don't add records to expandable array if they're already there
This commit is contained in:
parent
fb120af69e
commit
358b7cc0c0
|
@ -12,7 +12,7 @@ Travis.ExpandableRecordArray = Ember.RecordArray.extend
|
||||||
|
|
||||||
array.removeObserver 'isLoaded', observer
|
array.removeObserver 'isLoaded', observer
|
||||||
array.forEach (record) ->
|
array.forEach (record) ->
|
||||||
self.pushObject record
|
self.pushObject(record) unless self.contains(record)
|
||||||
|
|
||||||
self.set 'isLoading', false
|
self.set 'isLoading', false
|
||||||
self.set 'isLoaded', true
|
self.set 'isLoaded', true
|
||||||
|
@ -30,7 +30,8 @@ Travis.ExpandableRecordArray = Ember.RecordArray.extend
|
||||||
addedObjects = array.slice index, index + addedCount
|
addedObjects = array.slice index, index + addedCount
|
||||||
for object in addedObjects
|
for object in addedObjects
|
||||||
if @get('filterWith').call this, object
|
if @get('filterWith').call this, object
|
||||||
@pushObject object
|
@pushObject(object) unless @contains(object)
|
||||||
|
|
||||||
pushObject: (record) ->
|
pushObject: (record) ->
|
||||||
@get('content').pushObject(record)
|
if content = @get('content')
|
||||||
|
content.pushObject(record) unless content.contains(record)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user