mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Moved source code under src folder - massive change
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return 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" />');
|
||||
var promise = this.model.save();
|
||||
|
||||
promise.done(function () {
|
||||
self.$el.html('<i class="icon-ok" title="Added to downloaded queue" />');
|
||||
});
|
||||
|
||||
promise.fail(function () {
|
||||
self.$el.html('<i class="icon-download-alt" title="Add to download queue" />');
|
||||
});
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user