codecombat/app/collections/CocoCollection.coffee

17 lines
344 B
CoffeeScript
Raw Normal View History

2014-01-03 13:32:13 -05:00
module.exports = class CocoCollection extends Backbone.Collection
loaded: false
initialize: ->
super()
@once 'sync', =>
@loaded = true
model.loaded = true for model in @models
getURL: ->
return if _.isString @url then @url else @url()
fetch: ->
@jqxhr = super(arguments...)
@loading = true
@jqxhr