mirror of
https://github.com/Radarr/Radarr
synced 2025-03-01 01:16:14 +00:00
31 lines
No EOL
964 B
JavaScript
31 lines
No EOL
964 B
JavaScript
var Backgrid = require('backgrid');
|
|
|
|
module.exports = Backgrid.Cell.extend({
|
|
className : 'download-report-cell',
|
|
events : {click : '_onClick'},
|
|
_onClick : function(){
|
|
if(!this.model.get('downloadAllowed')) {
|
|
return;
|
|
}
|
|
var self = this;
|
|
this.$el.html('<i class="icon-spinner icon-spin" />');
|
|
this.model.save(null, {
|
|
success : function(){
|
|
self.model.set('queued', true);
|
|
}
|
|
});
|
|
},
|
|
render : function(){
|
|
this.$el.empty();
|
|
if(this.model.get('queued')) {
|
|
this.$el.html('<i class="icon-nd-downloading" title="Added to downloaded queue" />');
|
|
}
|
|
else if(this.model.get('downloadAllowed')) {
|
|
this.$el.html('<i class="icon-download-alt" title="Add to download queue" />');
|
|
}
|
|
else {
|
|
this.className = 'no-download-report-cell';
|
|
}
|
|
return this;
|
|
}
|
|
}); |