1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-03-05 15:15:59 +02:00

45 lines
1.4 KiB
JavaScript
Raw Normal View History

2013-05-24 23:38:43 -07:00
"use strict";
define([
'app',
'Settings/Notifications/Model'
], function () {
NzbDrone.Settings.Notifications.AddItemView = Backbone.Marionette.ItemView.extend({
template : 'Settings/Notifications/AddItemTemplate',
2013-05-26 22:27:33 -07:00
tagName : 'li',
2013-05-24 23:38:43 -07:00
events: {
2013-05-25 17:36:12 -07:00
'click': 'addNotification'
2013-05-24 23:38:43 -07:00
},
2013-05-28 19:49:17 -07:00
initialize: function (options) {
this.notificationCollection = options.notificationCollection;
},
2013-05-25 17:36:12 -07:00
addNotification: function () {
2013-05-24 23:38:43 -07:00
this.model.set('id', undefined);
2013-05-26 22:27:33 -07:00
this.model.set('name', '');
2013-05-28 19:49:17 -07:00
var view = new NzbDrone.Settings.Notifications.EditView({ model: this.model, notificationCollection: this.notificationCollection });
2013-05-24 23:38:43 -07:00
NzbDrone.modalRegion.show(view);
}
});
NzbDrone.Settings.Notifications.AddView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Settings.Notifications.AddItemView,
2013-05-26 22:27:33 -07:00
itemViewContainer : '.notifications .items',
2013-05-28 19:49:17 -07:00
template : 'Settings/Notifications/AddTemplate',
itemViewOptions: function () {
return {
notificationCollection: this.notificationCollection
};
},
initialize: function (options) {
this.notificationCollection = options.notificationCollection;
}
2013-05-24 23:38:43 -07:00
});
});