1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-13 22:43:35 +01:00
Radarr/UI/AddSeries/AddSeriesLayout.js

46 lines
1.4 KiB
JavaScript

"use strict";
define([
'app',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/RootFolderCollection',
'AddSeries/RootFolders/RootFolderView',
'AddSeries/AddSeriesView',
'AddSeries/Existing/ImportSeriesView'
],
function (app, qualityProfileCollection, rootFolderCollection) {
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
template: 'AddSeries/addSeriesLayoutTemplate',
regions: {
workspace: '#add-series-workspace'
},
events: {
'click .x-import': '_importSeries'
},
initialize: function () {
this.rootFolderLayout = new NzbDrone.AddSeries.RootFolders.Layout();
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
},
_folderSelected: function (options) {
NzbDrone.modalRegion.closeModal();
this.workspace.show(new NzbDrone.AddSeries.Existing.ListView({model: options.model}));
},
onRender: function () {
qualityProfileCollection.fetch();
rootFolderCollection.fetch();
this.workspace.show(new NzbDrone.AddSeries.AddSeriesView());
},
_importSeries: function () {
NzbDrone.modalRegion.show(this.rootFolderLayout);
}
});
});