2013-06-01 21:31:39 +02:00
|
|
|
"use strict";
|
2013-06-15 01:18:37 +02:00
|
|
|
define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','backstrech'], function () {
|
2013-06-01 21:31:39 +02:00
|
|
|
NzbDrone.Series.Details.SeriesDetailsLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
|
|
|
|
itemViewContainer: '.x-series-seasons',
|
|
|
|
template : 'Series/Details/SeriesDetailsTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
seasons: '#seasons'
|
|
|
|
},
|
|
|
|
|
2013-06-07 07:15:07 +02:00
|
|
|
ui: {
|
|
|
|
header: '.x-header'
|
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
$('body').addClass('backdrop');
|
|
|
|
},
|
2013-06-01 21:31:39 +02:00
|
|
|
|
2013-06-07 07:15:07 +02:00
|
|
|
onShow: function () {
|
2013-06-01 21:31:39 +02:00
|
|
|
var self = this;
|
|
|
|
|
2013-06-14 02:39:53 +02:00
|
|
|
if (this.model.has('fanArt')) {
|
|
|
|
$.backstretch(this.model.get('fanArt'));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('body').removeClass('backdrop');
|
|
|
|
}
|
2013-06-07 07:15:07 +02:00
|
|
|
|
2013-06-01 21:31:39 +02:00
|
|
|
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();
|
2013-06-07 07:15:07 +02:00
|
|
|
$('body').removeClass('backdrop');
|
2013-06-01 21:31:39 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|