1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-31 11:24:23 +02:00

38 lines
853 B
JavaScript
Raw Normal View History

2013-06-21 23:24:24 -07:00
'use strict';
2013-06-20 18:43:58 -07:00
define(
[
'marionette'
], function (Marionette) {
return Marionette.ItemView.extend({
2013-07-11 08:16:47 -07:00
template: 'AddSeries/RootFolders/ItemViewTemplate',
2013-06-20 18:43:58 -07:00
tagName : 'tr',
initialize: function () {
this.listenTo(this.model, 'change', this.render);
},
2013-06-20 18:43:58 -07:00
events: {
2013-06-27 18:55:45 -07:00
'click .x-delete': 'removeFolder',
2013-06-20 18:43:58 -07:00
'click .x-folder': 'folderSelected'
},
removeFolder: function () {
var self = this;
this.model.destroy()
.success(function(){
self.close();
});
2013-06-20 18:43:58 -07:00
},
folderSelected: function () {
this.trigger('folderSelected', this.model);
}
});
});