mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 00:28:31 -05:00
21 lines
506 B
CoffeeScript
21 lines
506 B
CoffeeScript
CocoModel = require 'models/CocoModel'
|
|
|
|
module.exports = class CocoCollection extends Backbone.Collection
|
|
loaded: false
|
|
model: null
|
|
|
|
initialize: ->
|
|
if not @model
|
|
console.error @constructor.name, 'does not have a model defined. This will not do!'
|
|
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
|