jshint all the things

Small style fixes here and there. Removed one unused file.
This commit is contained in:
lilia 2015-02-19 00:20:22 -08:00
parent 76da5bb4f9
commit ec43a0b633
9 changed files with 36 additions and 55 deletions

View file

@ -68,20 +68,23 @@ var Whisper = Whisper || {};
var promises = [];
var files = this.$input.prop('files');
for (var i = 0; i < files.length; i++) {
var contentType = files[i].type;
var p = new Promise(function(resolve, reject) {
var FR = new FileReader();
FR.onload = function(e) {
resolve({data: e.target.result, contentType: contentType});
};
FR.readAsArrayBuffer(files[i]);
}.bind(this));
promises.push(p);
promises.push(readFile(files[i]));
}
this.clearForm();
return Promise.all(promises);
},
readFile: function(file) {
var contentType = file.type;
return new Promise(function(resolve, reject) {
var FR = new FileReader();
FR.onload = function(e) {
resolve({data: e.target.result, contentType: contentType});
};
FR.readAsArrayBuffer(file);
});
},
clearForm: function() {
this.thumb.remove();
},