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,
|
originalFetch: Backbone.Collection.prototype.fetch,
|
||||||
|
|
||||||
initialize: function (options) {
|
initialize: function (options) {
|
||||||
|
if (!options.episodeId) {
|
||||||
|
throw 'episodeId is required';
|
||||||
|
}
|
||||||
|
|
||||||
this.episodeId = options.episodeId;
|
this.episodeId = options.episodeId;
|
||||||
},
|
},
|
||||||
|
|
||||||
fetch: function (options) {
|
fetch: function (options) {
|
||||||
if (!this.episodeId) {
|
options = options || {};
|
||||||
throw 'episodeId is required';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!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…
Reference in New Issue