2013-06-09 20:51:32 +00:00
|
|
|
"use strict";
|
|
|
|
|
2013-06-15 05:28:35 +00:00
|
|
|
define(['app','backgrid'], function () {
|
2013-06-14 23:18:37 +00:00
|
|
|
NzbDrone.Release.DownloadReportCell = Backgrid.Cell.extend({
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
className: "download-report-cell",
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
events: {
|
|
|
|
'click': '_onClick'
|
|
|
|
},
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
_onClick: function () {
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
var self = this;
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
this.$el.html('<i class ="icon-spinner icon-spin" />');
|
|
|
|
this.model.save()
|
|
|
|
.always(function () {
|
|
|
|
self.$el.html('<i class ="icon-download-alt" />');
|
|
|
|
});
|
|
|
|
},
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
render: function () {
|
2013-06-09 20:51:32 +00:00
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
this.$el.html('<i class ="icon-download-alt" />');
|
|
|
|
return this;
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return NzbDrone.Release.DownloadReportCell;
|
2013-06-09 20:51:32 +00:00
|
|
|
});
|