Skip to content

Instantly share code, notes, and snippets.

@d30jeff
Created October 18, 2016 03:21
Show Gist options
  • Save d30jeff/72dd30d0363eeb95d8da2d75c4196e2e to your computer and use it in GitHub Desktop.
Save d30jeff/72dd30d0363eeb95d8da2d75c4196e2e to your computer and use it in GitHub Desktop.
What is this front end bullshit
$(function() {
dropzoneBody.ondrop = function(e) {
e.stopPropagation();
e.preventDefault();
var self = this;
self.className = 'dropzone'; // adds the border placeholder
var file = e.dataTransfer.files[0];
var reader = new FileReader();
$("#loader").show();
reader.onload = function(event) {
var result = event.target.result;
var lines = result.split('\n');
setTimeout(function() {
lines.forEach(function(perLine) {
readData(perLine);
});
$("#loader").hide();
}, 0);
};
reader.readAsText(file);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment