2013-06-21 23:24:24 -07:00
|
|
|
'use strict';
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'backgrid'
|
|
|
|
], function (Backgrid) {
|
|
|
|
return Backgrid.Cell.extend({
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
className: 'download-report-cell',
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
events: {
|
|
|
|
'click': '_onClick'
|
|
|
|
},
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
_onClick: function () {
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
var self = this;
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
this.$el.html('<i class =\'icon-spinner icon-spin\' />');
|
|
|
|
this.model.save().always(function () {
|
2013-07-02 17:44:22 -07:00
|
|
|
self.$el.html('<i class =\'icon-download-alt\' title=\'Add to download queue\' />');
|
|
|
|
});
|
2013-06-24 16:41:59 -07:00
|
|
|
},
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
render: function () {
|
2013-06-09 13:51:32 -07:00
|
|
|
|
2013-07-02 17:44:22 -07:00
|
|
|
this.$el.html('<i class =\'icon-download-alt\' title=\'Add to download queue\' />');
|
2013-06-24 16:41:59 -07:00
|
|
|
return this;
|
2013-06-14 16:18:37 -07:00
|
|
|
|
2013-06-24 16:41:59 -07:00
|
|
|
}
|
|
|
|
});
|
2013-06-14 16:18:37 -07:00
|
|
|
});
|