EpisodeActivity cleanup

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

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

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

Loading…
Cancel
Save