1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-25 22:46:31 -04:00
Files
Sonarr/src/UI/Settings/Notifications/AddItemView.js
T
2013-10-08 22:48:40 -07:00

38 lines
1001 B
JavaScript

'use strict';
define([
'AppLayout',
'marionette',
'Settings/Notifications/EditView'
], function (AppLayout, Marionette, EditView) {
return Marionette.ItemView.extend({
template: 'Settings/Notifications/AddItemTemplate',
tagName : 'li',
events: {
'click': 'addNotification'
},
initialize: function (options) {
this.notificationCollection = options.notificationCollection;
},
addNotification: function (e) {
if (this.$(e.target).hasClass('icon-info-sign')) {
return;
}
this.model.set({
id: undefined,
name: this.model.get('implementationName'),
onGrab: true,
onDownload: true
});
var editView = new EditView({ model: this.model, notificationCollection: this.notificationCollection });
AppLayout.modalRegion.show(editView);
}
});
});