mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
27 lines
708 B
JavaScript
27 lines
708 B
JavaScript
![]() |
NEWSBLUR.Models.FeedOrFolder = Backbone.Model.extend({
|
||
|
|
||
|
initialize: function(model) {
|
||
|
console.log(["constructing model", model]);
|
||
|
if (_.isNumber(model)) {
|
||
|
this.model = NEWSBLUR.assets.feeds.get(model);
|
||
|
} else {
|
||
|
this.model = new NEWSBLUR.Collections.Folders();
|
||
|
this.title = _.keys(model)[0];
|
||
|
var children = model[this.title];
|
||
|
this.model.parse(children);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
NEWSBLUR.Collections.Folders = Backbone.Collection.extend({
|
||
|
|
||
|
model: NEWSBLUR.Models.FeedOrFolder,
|
||
|
|
||
|
parse: function(models) {
|
||
|
console.log(["parse", this.models, models]);
|
||
|
this.reset(models);
|
||
|
}
|
||
|
|
||
|
|
||
|
});
|