Merge branch 'master' of https://github.com/swapkh91/codecombat into swapkh91-master

Conflicts:
	app/models/SuperModel.coffee
This commit is contained in:
Scott Erickson 2014-03-26 14:29:16 -07:00
commit fae9034dfc
5 changed files with 8 additions and 8 deletions

View file

@ -232,4 +232,4 @@ module.exports = class LevelLoader extends CocoClass
Backbone.Mediator.publish 'level-loader:progress-changed', progress: @progress()
@initWorld() if @allDone()
@trigger 'progress'
@trigger 'loaded-all' if @progress() is 1
@trigger 'loaded-all' if @progress() is 1

View file

@ -9,7 +9,7 @@ class SuperModel
@mustPopulate = model
model.saveBackups = @shouldSaveBackups(model)
model.fetch() unless model.loaded or model.loading
@listenToOnce(model, 'sync', @modelLoaded) unless model.loaded
@listenTo(model, 'sync', @modelLoaded) unless model.loaded
@listenToOnce(model, 'error', @modelErrored) unless model.loaded
url = model.url()
@models[url] = model unless @models[url]?
@ -40,7 +40,7 @@ class SuperModel
continue if @models[refURL]
@models[refURL] = ref
ref.fetch()
@listenToOnce(ref, 'sync', @modelLoaded)
ref.once 'sync', @modelLoaded, @
@trigger 'loaded-one', model: model
@trigger 'loaded-all' if @finished()

View file

@ -24,7 +24,7 @@ module.exports = class WizardSettingsView extends CocoView
@wizardThangType = new ThangType()
@wizardThangType.url = -> '/db/thang.type/wizard'
@wizardThangType.fetch()
@wizardThangType.once 'sync', @initCanvas, @
@listenToOnce(@wizardThangType, 'sync', @initCanvas)
initCanvas: ->
@startsLoading = false

View file

@ -11,8 +11,8 @@ module.exports = class ColorsTabView extends CocoView
offset: 0
constructor: (@thangType, options) ->
@thangType.once 'sync', @tryToBuild, @
@thangType.schema().once 'sync', @tryToBuild, @
@listenToOnce(@thangType, 'sync', @tryToBuild)
@listenToOnce(@thangType.schema(), 'sync', @tryToBuild)
@colorConfig = { hue: 0, saturation: 0.5, lightness: 0.5 }
@spriteBuilder = new SpriteBuilder(@thangType)
f = =>

View file

@ -38,8 +38,8 @@ module.exports = class VictoryModal extends View
@feedback = new LevelFeedback()
@feedback.url = -> url
@feedback.fetch()
@feedback.once 'sync', => @onFeedbackLoaded()
@feedback.once 'error', => @onFeedbackNotFound()
@listenToOnce(@feedback, 'sync', -> @onFeedbackLoaded())
@listenToOnce(@feedback, 'error', -> @onFeedbackNotFound())
onFeedbackLoaded: ->
@feedback.url = -> '/db/level.feedback/' + @id