You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/UI/Settings/Notifications/CollectionView.js

29 lines
1.0 KiB

'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: '.notifications',
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);
}
});
});