mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
38 lines
853 B
JavaScript
38 lines
853 B
JavaScript
'use strict';
|
|
|
|
define(
|
|
[
|
|
'marionette'
|
|
], function (Marionette) {
|
|
|
|
return Marionette.ItemView.extend({
|
|
|
|
template: 'AddSeries/RootFolders/ItemViewTemplate',
|
|
tagName : 'tr',
|
|
|
|
initialize: function () {
|
|
this.listenTo(this.model, 'change', this.render);
|
|
},
|
|
|
|
|
|
events: {
|
|
'click .x-delete': 'removeFolder',
|
|
'click .x-folder': 'folderSelected'
|
|
},
|
|
|
|
removeFolder: function () {
|
|
|
|
var self = this;
|
|
|
|
this.model.destroy()
|
|
.success(function(){
|
|
self.close();
|
|
});
|
|
},
|
|
|
|
folderSelected: function () {
|
|
this.trigger('folderSelected', this.model);
|
|
}
|
|
});
|
|
});
|