mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
28 lines
1,014 B
JavaScript
28 lines
1,014 B
JavaScript
'use strict';
|
|
define([
|
|
'app',
|
|
'marionette',
|
|
'Settings/Notifications/Collection',
|
|
'Settings/Notifications/ItemView',
|
|
'Settings/Notifications/AddView'
|
|
], function (App, Marionette, NotificationCollection, NotificationItemView, AddSelectionNotificationView) {
|
|
return Marionette.CompositeView.extend({
|
|
itemView : NotificationItemView,
|
|
itemViewContainer: 'tbody',
|
|
template : 'Settings/Notifications/CollectionTemplate',
|
|
|
|
events: {
|
|
'click .x-add': 'openSchemaModal'
|
|
},
|
|
|
|
openSchemaModal: function () {
|
|
var schemaCollection = new NotificationCollection();
|
|
schemaCollection.url = '/api/notification/schema';
|
|
schemaCollection.fetch();
|
|
schemaCollection.url = '/api/notification';
|
|
|
|
var view = new AddSelectionNotificationView({ collection: schemaCollection, notificationCollection: this.collection});
|
|
App.modalRegion.show(view);
|
|
}
|
|
});
|
|
});
|