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