You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
706 B
39 lines
706 B
define([
|
|
"backbone"
|
|
, "models/dmap"
|
|
]
|
|
, function (Backbone, DMAPModel) {
|
|
var that
|
|
|
|
, Collection = Backbone.Collection.extend({
|
|
model: DMAPModel
|
|
|
|
, attributes: {}
|
|
|
|
, initialize: function (attributes, options) {
|
|
that = this;
|
|
|
|
options.fetch && that.fetch = options.fetch && delete options.fetch;
|
|
|
|
_.extend({}, that.attributes, attributes);
|
|
|
|
Model.__super__.set(that, [undefined, options]);
|
|
|
|
return that;
|
|
}
|
|
|
|
, fetch: function (options) {
|
|
that.trigger("dmap.collection.fetch", this, arguments);
|
|
|
|
return that;
|
|
}
|
|
|
|
, push: function (attributes, options) {
|
|
that.trigger("dmap.collection.push", this, arguments);
|
|
|
|
return that;
|
|
}
|
|
});
|
|
|
|
return Collection;
|
|
}); |