1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-14 15:03:42 +01:00
Radarr/UI/AddSeries/AddSeriesLayout.js
Mark McDowall 1ef168370e Recent folder list will scroll when needed
Able to add more than one recent folder without refreshing the page
2013-08-04 10:52:21 -07:00

66 lines
1.9 KiB
JavaScript

'use strict';
define(
[
'app',
'marionette',
'AddSeries/RootFolders/Layout',
'AddSeries/Existing/CollectionView',
'AddSeries/AddSeriesView',
'Quality/QualityProfileCollection',
'AddSeries/RootFolders/Collection',
'Series/SeriesCollection'
], function (App,
Marionette,
RootFolderLayout,
ExistingSeriesCollectionView,
AddSeriesView,
QualityProfileCollection,
RootFolderCollection,
SeriesCollection) {
return Marionette.Layout.extend({
template: 'AddSeries/AddSeriesLayoutTemplate',
regions: {
workspace: '#add-series-workspace'
},
events: {
'click .x-import': '_importSeries',
'click .x-add-new': '_addSeries'
},
attributes: {
id: 'add-series-screen'
},
initialize: function () {
SeriesCollection.fetch();
QualityProfileCollection.fetch();
RootFolderCollection.fetch();
},
onShow: function () {
this.workspace.show(new AddSeriesView());
},
_folderSelected: function (options) {
App.vent.trigger(App.Commands.CloseModalCommand);
this.workspace.show(new ExistingSeriesCollectionView({model: options.model}));
},
_importSeries: function () {
this.rootFolderLayout = new RootFolderLayout();
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
App.modalRegion.show(this.rootFolderLayout);
},
_addSeries: function () {
this.workspace.show(new AddSeriesView());
}
});
});