2013-05-20 06:19:54 +02:00
|
|
|
|
'use strict';
|
2013-05-25 08:38:43 +02:00
|
|
|
|
define(['app', 'Settings/Notifications/ItemView', 'Settings/Notifications/AddView'], function () {
|
2013-05-20 06:19:54 +02:00
|
|
|
|
NzbDrone.Settings.Notifications.CollectionView = Backbone.Marionette.CompositeView.extend({
|
|
|
|
|
itemView : NzbDrone.Settings.Notifications.ItemView,
|
2013-05-21 08:16:19 +02:00
|
|
|
|
itemViewContainer : 'tbody',
|
2013-05-25 08:38:43 +02:00
|
|
|
|
template : 'Settings/Notifications/CollectionTemplate',
|
|
|
|
|
|
|
|
|
|
events: {
|
2013-05-26 02:36:12 +02:00
|
|
|
|
'click .x-add': 'openSchemaModal'
|
|
|
|
|
},
|
2013-05-25 08:38:43 +02:00
|
|
|
|
|
2013-05-26 02:36:12 +02:00
|
|
|
|
openSchemaModal: function () {
|
2013-05-28 17:06:36 +02:00
|
|
|
|
var schemaCollection = new NzbDrone.Settings.Notifications.Collection();
|
|
|
|
|
schemaCollection.url = '/api/notification/schema';
|
|
|
|
|
schemaCollection.fetch();
|
2013-05-29 04:49:17 +02:00
|
|
|
|
schemaCollection.url = '/api/notification';
|
2013-05-26 02:36:12 +02:00
|
|
|
|
|
2013-05-29 04:49:17 +02:00
|
|
|
|
var view = new NzbDrone.Settings.Notifications.AddView({ collection: schemaCollection, notificationCollection: this.collection});
|
2013-05-26 02:36:12 +02:00
|
|
|
|
NzbDrone.modalRegion.show(view);
|
2013-05-25 08:38:43 +02:00
|
|
|
|
}
|
2013-05-20 06:19:54 +02:00
|
|
|
|
});
|
|
|
|
|
});
|