Deleting episode files from episode details is a go

New: Delete episode file from episode details
This commit is contained in:
Mark McDowall
2013-11-28 22:31:46 -08:00
parent 133ee1a0b3
commit ce6a299c98
6 changed files with 122 additions and 15 deletions
+33
View File
@@ -0,0 +1,33 @@
'use strict';
define(
[
'vent',
'backgrid'
], function (vent, Backgrid) {
return Backgrid.Cell.extend({
className : 'delete-episode-file-cell',
events: {
'click': '_onClick'
},
render: function () {
this.$el.empty();
this.$el.html('<i class="icon-nd-delete"></i>');
return this;
},
_onClick: function () {
var self = this;
if (window.confirm('Are you sure you want to delete \'{0}\' form disk?'.format(this.model.get('path')))) {
this.model.destroy()
.done(function () {
vent.trigger(vent.Events.EpisodeFileDeleted, { episodeFile: self.model });
});
}
}
});
});