You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
730 B
27 lines
730 B
var vent = require('vent');
|
|
var Backgrid = require('backgrid');
|
|
|
|
module.exports = Backgrid.Cell.extend({
|
|
className : 'delete-episode-file-cell',
|
|
|
|
events : {
|
|
'click' : '_onClick'
|
|
},
|
|
|
|
render : function() {
|
|
this.$el.empty();
|
|
this.$el.html('<i class="icon-lidarr-delete" title="Delete episode file from disk"></i>');
|
|
|
|
return this;
|
|
},
|
|
|
|
_onClick : function() {
|
|
var self = this;
|
|
|
|
if (window.confirm('Are you sure you want to delete \'{0}\' from disk?'.format(this.model.get('path')))) {
|
|
this.model.destroy().done(function() {
|
|
vent.trigger(vent.Events.EpisodeFileDeleted, { episodeFile : self.model });
|
|
});
|
|
}
|
|
}
|
|
}); |