UI Cleanup - Updated Series subtree.

This commit is contained in:
Taloth Saldono
2015-02-13 23:09:36 +01:00
parent 1bf433872a
commit b69ea349ce
25 changed files with 970 additions and 618 deletions
+12 -8
View File
@@ -6,24 +6,28 @@ var SeriesDetailsLayout = require('./Details/SeriesDetailsLayout');
module.exports = NzbDroneController.extend({
_originalInit : NzbDroneController.prototype.initialize,
initialize : function(){
initialize : function() {
this.route('', this.series);
this.route('series', this.series);
this.route('series/:query', this.seriesDetails);
this._originalInit.apply(this, arguments);
},
series : function(){
series : function() {
this.setTitle('Sonarr');
this.showMainRegion(new SeriesIndexLayout());
},
seriesDetails : function(query){
var series = SeriesCollection.where({titleSlug : query});
if(series.length !== 0) {
seriesDetails : function(query) {
var series = SeriesCollection.where({ titleSlug : query });
if (series.length !== 0) {
var targetSeries = series[0];
this.setTitle(targetSeries.get('title'));
this.showMainRegion(new SeriesDetailsLayout({model : targetSeries}));
}
else {
this.showMainRegion(new SeriesDetailsLayout({ model : targetSeries }));
} else {
this.showNotFound();
}
}