mirror of
https://github.com/fergalmoran/Readarr.git
synced 2025-12-31 22:09:07 +00:00
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
define([
|
|
'AppLayout',
|
|
'marionette',
|
|
'Settings/Notifications/NotificationEditView'
|
|
], 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,
|
|
onUpgrade : true
|
|
});
|
|
|
|
var editView = new EditView({ model: this.model, notificationCollection: this.notificationCollection });
|
|
AppLayout.modalRegion.show(editView);
|
|
}
|
|
});
|
|
});
|