made RootFolderCollection, NotificationCollection singleton.

This commit is contained in:
kay.one
2013-02-14 09:18:29 -08:00
parent 52d815b1d4
commit a2496530ca
27 changed files with 639 additions and 14886 deletions
@@ -1,4 +1,4 @@
define(['app', 'AddSeries/New/SearchResultView'], function () {
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/New/SearchResultView', 'Shared/SpinnerView'], function (app, rootFolders) {
NzbDrone.AddSeries.New.AddNewSeriesView = Backbone.Marionette.Layout.extend({
template: 'AddSeries/New/AddNewSeriesTemplate',
@@ -15,15 +15,11 @@
collection: new NzbDrone.AddSeries.SearchResultCollection(),
initialize: function (options) {
if (options.rootFolders === undefined) {
throw 'rootFolder arg. is required.';
}
if (options.qualityProfiles === undefined) {
throw 'qualityProfiles arg. is required.';
}
this.rootFoldersCollection = options.rootFolders;
this.qualityProfileCollection = options.qualityProfiles;
},
@@ -73,7 +69,7 @@
resultUpdated: function (options, context) {
_.each(options.models, function (model) {
model.set('rootFolders', context.rootFoldersCollection);
model.set('rootFolders', rootFolders);
model.set('qualityProfiles', context.qualityProfileCollection);
});