mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Fixed a bug with the new race condition fix. Moving the schemas to the application would be good.
This commit is contained in:
parent
ad6317434d
commit
afbe2200a6
2 changed files with 4 additions and 4 deletions
|
@ -16,6 +16,7 @@ class CocoModel extends Backbone.Model
|
|||
|
||||
initialize: ->
|
||||
super()
|
||||
@constructor.schema ?= new CocoSchema(@urlRoot)
|
||||
if not @constructor.className
|
||||
console.error("#{@} needs a className set.")
|
||||
@markToRevert()
|
||||
|
@ -52,10 +53,8 @@ class CocoModel extends Backbone.Model
|
|||
@backedUp = {}
|
||||
|
||||
loadSchema: ->
|
||||
unless @constructor.schema
|
||||
@constructor.schema = new CocoSchema(@urlRoot)
|
||||
return if @constructor.schema.loading
|
||||
@constructor.schema.fetch()
|
||||
|
||||
@constructor.schema.once 'sync', =>
|
||||
@constructor.schema.loaded = true
|
||||
@addSchemaDefaults()
|
||||
|
|
|
@ -42,6 +42,7 @@ module.exports = class ThangTypeEditView extends View
|
|||
@thangType = new ThangType(_id: @thangTypeID)
|
||||
@thangType.saveBackups = true
|
||||
@thangType.fetch()
|
||||
@thangType.loadSchema()
|
||||
@thangType.schema().once 'sync', @onThangTypeSync, @
|
||||
@thangType.once 'sync', @onThangTypeSync, @
|
||||
@refreshAnimation = _.debounce @refreshAnimation, 500
|
||||
|
|
Loading…
Reference in a new issue