2013-03-29 19:37:10 +01:00
|
|
|
|
"use strict";
|
|
|
|
|
define([
|
2013-02-22 07:18:36 +01:00
|
|
|
|
'app',
|
|
|
|
|
'Quality/QualityProfileCollection',
|
2013-05-28 07:40:58 +02:00
|
|
|
|
'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'
|
2013-02-14 03:28:56 +01:00
|
|
|
|
],
|
2013-05-28 07:40:58 +02:00
|
|
|
|
function (app, qualityProfileCollection, rootFolderCollection) {
|
2013-02-14 03:28:56 +01:00
|
|
|
|
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
|
template: 'AddSeries/addSeriesLayoutTemplate',
|
|
|
|
|
|
|
|
|
|
regions: {
|
2013-05-27 04:53:56 +02:00
|
|
|
|
workspace: '#add-series-workspace'
|
2013-02-14 03:28:56 +01:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
events: {
|
2013-05-27 04:53:56 +02:00
|
|
|
|
'click .x-import': '_importSeries'
|
2013-02-14 03:28:56 +01:00
|
|
|
|
},
|
|
|
|
|
|
2013-05-28 04:05:34 +02:00
|
|
|
|
initialize: function () {
|
|
|
|
|
this.rootFolderLayout = new NzbDrone.AddSeries.RootFolders.Layout();
|
|
|
|
|
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
|
|
|
|
|
|
|
|
|
|
},
|
2013-02-14 03:28:56 +01:00
|
|
|
|
|
2013-05-28 04:05:34 +02:00
|
|
|
|
_folderSelected: function (options) {
|
|
|
|
|
NzbDrone.modalRegion.closeModal();
|
|
|
|
|
this.workspace.show(new NzbDrone.AddSeries.Existing.ListView({model: options.model}));
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onRender: function () {
|
2013-02-15 03:40:29 +01:00
|
|
|
|
qualityProfileCollection.fetch();
|
2013-05-27 04:53:56 +02:00
|
|
|
|
rootFolderCollection.fetch();
|
2013-02-14 03:28:56 +01:00
|
|
|
|
|
2013-05-27 04:53:56 +02:00
|
|
|
|
this.workspace.show(new NzbDrone.AddSeries.AddSeriesView());
|
2013-02-14 03:28:56 +01:00
|
|
|
|
},
|
|
|
|
|
|
2013-05-27 04:53:56 +02:00
|
|
|
|
_importSeries: function () {
|
2013-05-28 04:05:34 +02:00
|
|
|
|
NzbDrone.modalRegion.show(this.rootFolderLayout);
|
2013-02-15 03:40:29 +01:00
|
|
|
|
}
|
2013-02-14 03:28:56 +01:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|