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