rjs -> webpack

This commit is contained in:
Keivan Beigi
2015-02-02 17:18:45 -08:00
parent 344f3d66ef
commit 428a1439e5
399 changed files with 11591 additions and 16139 deletions
+28 -49
View File
@@ -1,52 +1,31 @@
'use strict';
var Backgrid = require('backgrid');
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" />');
//Using success callback instead of promise so it
//gets called before the sync event is triggered
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;
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;
}
});