1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Settings/Notifications/CollectionView.js

29 lines
1014 B
JavaScript
Raw Normal View History

2013-05-20 07:19:54 +03:00
'use strict';
2013-06-19 04:02:23 +03:00
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',
2013-05-25 09:38:43 +03:00
events: {
2013-05-26 03:36:12 +03:00
'click .x-add': 'openSchemaModal'
},
2013-05-25 09:38:43 +03:00
2013-05-26 03:36:12 +03:00
openSchemaModal: function () {
2013-06-19 04:02:23 +03:00
var schemaCollection = new NotificationCollection();
2013-05-28 18:06:36 +03:00
schemaCollection.url = '/api/notification/schema';
schemaCollection.fetch();
2013-05-29 05:49:17 +03:00
schemaCollection.url = '/api/notification';
2013-05-26 03:36:12 +03:00
2013-06-19 04:02:23 +03:00
var view = new AddSelectionNotificationView({ collection: schemaCollection, notificationCollection: this.collection});
App.modalRegion.show(view);
2013-05-25 09:38:43 +03:00
}
2013-05-20 07:19:54 +03:00
});
});