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',
|
|
|
|
|
2013-07-12 00:28:57 +03:00
|
|
|
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 () {
|
2013-07-14 00:01:14 +03:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|