1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/AddSeries/RootFolders/ItemView.js

38 lines
853 B
JavaScript
Raw Normal View History

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