mirror of https://github.com/lidarr/Lidarr
EpisodeActivity cleanup
This commit is contained in:
parent
6cff6122a1
commit
7d2c6339bc
|
@ -11,18 +11,15 @@ define(
|
|||
originalFetch: Backbone.Collection.prototype.fetch,
|
||||
|
||||
initialize: function (options) {
|
||||
if (!options.episodeId) {
|
||||
throw 'episodeId is required';
|
||||
}
|
||||
|
||||
this.episodeId = options.episodeId;
|
||||
},
|
||||
|
||||
fetch: function (options) {
|
||||
if (!this.episodeId) {
|
||||
throw 'episodeId is required';
|
||||
}
|
||||
|
||||
if (!options) {
|
||||
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…
Reference in New Issue