Notification Schema in UI

This commit is contained in:
Mark McDowall 2013-05-24 23:38:43 -07:00
parent 42994ae39d
commit 3b09cc1240
5 changed files with 59 additions and 3 deletions

View file

@ -1,8 +1,19 @@
'use strict';
define(['app', 'Settings/Notifications/ItemView'], function () {
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'
template : 'Settings/Notifications/CollectionTemplate',
events: {
'click .x-add': 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);
}
}
});
});