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.
Readarr/src/UI/Episode/Activity/EpisodeActivityActionsCell.js

42 lines
1.0 KiB

'use strict';
define(
[
'jquery',
'vent',
'marionette',
'Cells/NzbDroneCell'
], function ($, vent, Marionette, NzbDroneCell) {
return NzbDroneCell.extend({
className: 'episode-actions-cell',
events: {
'click .x-failed' : '_markAsFailed'
},
render: function () {
this.$el.empty();
if (this.model.get('eventType') === 'grabbed') {
this.$el.html('<i class="icon-nd-delete x-failed" title="Mark download as failed"></i>');
}
return this;
},
_markAsFailed: function () {
var url = window.NzbDrone.ApiRoot + '/history/failed';
var data = {
id: this.model.get('id')
};
$.ajax({
url: url,
type: 'POST',
data: data
});
}
});
});