1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-15 15:32:33 +01:00
Radarr/UI/AddSeries/AddSeriesLayout.js

46 lines
1.4 KiB
JavaScript
Raw Normal View History

"use strict";
define([
2013-02-22 07:18:36 +01:00
'app',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/RootFolderCollection',
2013-02-22 07:18:36 +01:00
'AddSeries/RootFolders/RootFolderView',
2013-05-27 04:53:56 +02:00
'AddSeries/AddSeriesView',
2013-02-22 07:18:36 +01:00
'AddSeries/Existing/ImportSeriesView'
],
function (app, qualityProfileCollection, rootFolderCollection) {
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
template: 'AddSeries/addSeriesLayoutTemplate',
regions: {
2013-05-27 04:53:56 +02:00
workspace: '#add-series-workspace'
},
events: {
2013-05-27 04:53:56 +02:00
'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();
2013-05-27 04:53:56 +02:00
rootFolderCollection.fetch();
2013-05-27 04:53:56 +02:00
this.workspace.show(new NzbDrone.AddSeries.AddSeriesView());
},
2013-05-27 04:53:56 +02:00
_importSeries: function () {
NzbDrone.modalRegion.show(this.rootFolderLayout);
}
});
});