mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
UI dependency graph cleanup
This commit is contained in:
40
src/UI/Series/SeriesController.js
Normal file
40
src/UI/Series/SeriesController.js
Normal file
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Shared/NzbDroneController',
|
||||
'AppLayout',
|
||||
'Series/SeriesCollection',
|
||||
'Series/Index/SeriesIndexLayout',
|
||||
'Series/Details/SeriesDetailsLayout'
|
||||
], function (NzbDroneController, AppLayout, SeriesCollection, SeriesIndexLayout, SeriesDetailsLayout) {
|
||||
|
||||
return NzbDroneController.extend({
|
||||
|
||||
|
||||
initialize: function () {
|
||||
this.route('', this.series);
|
||||
this.route('series', this.series);
|
||||
this.route('series/:query', this.seriesDetails);
|
||||
},
|
||||
|
||||
|
||||
series: function () {
|
||||
this.setTitle('NzbDrone');
|
||||
AppLayout.mainRegion.show(new SeriesIndexLayout());
|
||||
},
|
||||
|
||||
seriesDetails: function (query) {
|
||||
var series = SeriesCollection.where({titleSlug: query});
|
||||
|
||||
if (series.length !== 0) {
|
||||
var targetSeries = series[0];
|
||||
this.setTitle(targetSeries.get('title'));
|
||||
AppLayout.mainRegion.show(new SeriesDetailsLayout({ model: targetSeries }));
|
||||
}
|
||||
else {
|
||||
this.showNotFound();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user