1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/UI/Settings/Notifications/CollectionView.js
2013-05-25 17:36:12 -07:00

22 lines
841 B
JavaScript

'use strict';
define(['app', 'Settings/Notifications/ItemView', 'Settings/Notifications/AddView'], function () {
NzbDrone.Settings.Notifications.CollectionView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Settings.Notifications.ItemView,
itemViewContainer : 'tbody',
template : 'Settings/Notifications/CollectionTemplate',
events: {
'click .x-add': 'openSchemaModal'
},
openSchemaModal: function () {
var schema = new NzbDrone.Settings.Notifications.Collection();
schema.url = '/api/notification/schema';
schema.fetch();
var view = new NzbDrone.Settings.Notifications.AddView({ collection: schema});
NzbDrone.modalRegion.show(view);
}
});
});