Made the SuperModel a little bit more clever about handling duplicate loaded models, hopefully fixed .

This commit is contained in:
Scott Erickson 2014-08-26 16:46:23 -07:00
parent 98752159ca
commit 607a2a133f
2 changed files with 1 additions and 5 deletions

View file

@ -121,6 +121,7 @@ module.exports = class SuperModel extends Backbone.Model
if cachedModel
clone = $.extend true, {}, model.attributes
cachedModel.set(clone, {silent: true})
console.debug "Updated cached model <#{cachedModel.get('name') or cachedModel.getURL()}> with new data"
else
@registerModel(model)
collection

View file

@ -13,8 +13,6 @@ module.exports = class ThangType extends CocoModel
initialize: ->
super()
@building = {}
@setDefaults()
@on 'sync', @setDefaults
@spriteSheets = {}
## Testing memory clearing
@ -24,9 +22,6 @@ module.exports = class ThangType extends CocoModel
# @_previousAttributes.raw = null
#setTimeout f, 40000
setDefaults: ->
@resetRawData() unless @get('raw')
resetRawData: ->
@set('raw', {shapes: {}, containers: {}, animations: {}})