You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/UI/AddSeries/AddSeriesLayout.js

47 lines
1.4 KiB

'use strict';
12 years ago
define(
[
'app',
'marionette',
'AddSeries/RootFolders/Layout',
'AddSeries/Existing/CollectionView',
'AddSeries/AddSeriesView',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/Collection'
], function (App, Marionette, RootFolderLayout, ExistingSeriesCollectionView, AddSeriesView, qualityProfileCollection, rootFolderCollection) {
return Marionette.Layout.extend({
template: 'AddSeries/addSeriesLayoutTemplate',
regions: {
workspace: '#add-series-workspace'
},
events: {
'click .x-import': '_importSeries'
},
initialize: function () {
12 years ago
this.rootFolderLayout = new RootFolderLayout();
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
12 years ago
qualityProfileCollection.fetch();
rootFolderCollection.fetch();
},
12 years ago
onShow: function () {
this.workspace.show(new AddSeriesView());
},
12 years ago
_folderSelected: function (options) {
App.modalRegion.closeModal();
this.workspace.show(new ExistingSeriesCollectionView({model: options.model}));
},
_importSeries: function () {
12 years ago
App.modalRegion.show(this.rootFolderLayout);
}
});
});