mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
define([
|
|
'jquery',
|
|
'AppLayout',
|
|
'marionette',
|
|
'Settings/Notifications/Edit/NotificationEditView'
|
|
], function ($, AppLayout, Marionette, EditView) {
|
|
|
|
return Marionette.ItemView.extend({
|
|
template: 'Settings/Notifications/Add/NotificationAddItemViewTemplate',
|
|
tagName : 'li',
|
|
|
|
events: {
|
|
'click': '_add'
|
|
},
|
|
|
|
initialize: function (options) {
|
|
this.targetCollection = options.targetCollection;
|
|
},
|
|
|
|
_add: function (e) {
|
|
if (this.$(e.target).hasClass('icon-info-sign')) {
|
|
return;
|
|
}
|
|
|
|
this.model.set({
|
|
id : undefined,
|
|
name : this.model.get('implementation'),
|
|
onGrab : true,
|
|
onDownload : true,
|
|
onUpgrade : true
|
|
});
|
|
|
|
var editView = new EditView({ model: this.model, targetCollection: this.targetCollection });
|
|
AppLayout.modalRegion.show(editView);
|
|
}
|
|
});
|
|
});
|