1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-28 02:37:40 +00:00
Sonarr/UI/Settings/Notifications/CollectionView.js
2013-05-28 19:49:32 -07:00

21 lines
881 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 schemaCollection = new NzbDrone.Settings.Notifications.Collection();
schemaCollection.url = '/api/notification/schema';
schemaCollection.fetch();
var view = new NzbDrone.Settings.Notifications.AddView({ collection: schemaCollection});
NzbDrone.modalRegion.show(view);
}
});
});