EpisodeActivity cleanup

pull/2/head
Mark McDowall 11 years ago
parent 6cff6122a1
commit 7d2c6339bc

@ -11,18 +11,15 @@ define(
originalFetch: Backbone.Collection.prototype.fetch, originalFetch: Backbone.Collection.prototype.fetch,
initialize: function (options) { initialize: function (options) {
this.episodeId = options.episodeId; if (!options.episodeId) {
},
fetch: function (options) {
if (!this.episodeId) {
throw 'episodeId is required'; throw 'episodeId is required';
} }
if (!options) { this.episodeId = options.episodeId;
options = {}; },
}
fetch: function (options) {
options = options || {};
options.data = { episodeId: this.episodeId }; options.data = { episodeId: this.episodeId };
return this.originalFetch.call(this, options); return this.originalFetch.call(this, options);

@ -48,17 +48,12 @@ define(
this.series = options.series; this.series = options.series;
this.collection = new EpisodeActivityCollection({ episodeId: this.model.id }); this.collection = new EpisodeActivityCollection({ episodeId: this.model.id });
this.collection.fetch();
this.listenTo(this.collection, 'sync', this._showTable);
}, },
onShow: function () { onRender: function () {
var self = this;
this.activityTable.show(new LoadingView()); this.activityTable.show(new LoadingView());
var promise = this.collection.fetch();
promise.done(function () {
self._showTable();
});
}, },
_showTable: function () { _showTable: function () {

Loading…
Cancel
Save