parent
f7c78da4ed
commit
0c63e5ad81
@ -0,0 +1,24 @@
|
|||||||
|
"use strict";
|
||||||
|
define(['app', 'Series/Details/SeasonLayout', 'Series/SeasonCollection', 'Series/EpisodeCollection'], function () {
|
||||||
|
NzbDrone.Series.Details.SeasonCollectionView = Backbone.Marionette.CollectionView.extend({
|
||||||
|
|
||||||
|
itemView : NzbDrone.Series.Details.SeasonLayout,
|
||||||
|
|
||||||
|
initialize: function (options) {
|
||||||
|
|
||||||
|
if (!options.episodeCollection) {
|
||||||
|
throw 'episodeCollection is needed';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.episodeCollection = options.episodeCollection;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
itemViewOptions: function () {
|
||||||
|
return {
|
||||||
|
episodeCollection: this.episodeCollection
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,36 @@
|
|||||||
|
"use strict";
|
||||||
|
define(['app', 'Series/Details/SeasonCollectionView','Shared/LoadingView'], function () {
|
||||||
|
NzbDrone.Series.Details.SeriesDetailsLayout = Backbone.Marionette.Layout.extend({
|
||||||
|
|
||||||
|
itemViewContainer: '.x-series-seasons',
|
||||||
|
template : 'Series/Details/SeriesDetailsTemplate',
|
||||||
|
|
||||||
|
regions: {
|
||||||
|
seasons: '#seasons'
|
||||||
|
},
|
||||||
|
|
||||||
|
onShow: function () {
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
this.seasons.show(new NzbDrone.Shared.LoadingView());
|
||||||
|
|
||||||
|
this.seasonCollection = new NzbDrone.Series.SeasonCollection();
|
||||||
|
this.episodeCollection = new NzbDrone.Series.EpisodeCollection();
|
||||||
|
|
||||||
|
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }}))
|
||||||
|
.done(function () {
|
||||||
|
self.seasons.show(new NzbDrone.Series.Details.SeasonCollectionView({
|
||||||
|
collection : self.seasonCollection,
|
||||||
|
episodeCollection: self.episodeCollection
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
onClose: function () {
|
||||||
|
$('.backstretch').remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
@ -1,20 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonLayout', 'Series/SeasonCollection'], function () {
|
|
||||||
NzbDrone.Series.Details.SeriesDetailsView = Backbone.Marionette.CompositeView.extend({
|
|
||||||
|
|
||||||
itemView : NzbDrone.Series.Details.SeasonLayout,
|
|
||||||
itemViewContainer: '.x-series-seasons',
|
|
||||||
template : 'Series/Details/SeriesDetailsTemplate',
|
|
||||||
|
|
||||||
initialize: function () {
|
|
||||||
this.collection = new NzbDrone.Series.SeasonCollection();
|
|
||||||
this.collection.fetch({data: { seriesId: this.model.get('id') }});
|
|
||||||
|
|
||||||
//$.backstretch(this.model.get('fanArt'));
|
|
||||||
},
|
|
||||||
|
|
||||||
onClose: function(){
|
|
||||||
$('.backstretch').remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -0,0 +1 @@
|
|||||||
|
loading ...
|
Loading…
Reference in new issue