Files
Prowlarr/src/UI/Settings/DownloadClient/Add/DownloadClientAddItemView.js
T
2014-02-17 17:57:20 -08:00

37 lines
1017 B
JavaScript

'use strict';
define([
'AppLayout',
'marionette',
'Settings/DownloadClient/Edit/DownloadClientEditView'
], function (AppLayout, Marionette, EditView) {
return Marionette.ItemView.extend({
template: 'Settings/DownloadClient/Add/DownloadClientAddItemViewTemplate',
tagName : 'li',
events: {
'click': '_add'
},
initialize: function (options) {
this.downloadClientCollection = options.downloadClientCollection;
},
_add: function (e) {
if (this.$(e.target).hasClass('icon-info-sign')) {
return;
}
this.model.set({
id : undefined,
name : this.model.get('implementationName'),
enable : true
});
var editView = new EditView({ model: this.model, downloadClientCollection: this.downloadClientCollection });
AppLayout.modalRegion.show(editView);
}
});
});