file drop sidebar update

This commit is contained in:
Kenneth Jao 2018-08-28 12:53:13 -04:00
parent 4917e87b65
commit 21faf348f7

View File

@ -126,13 +126,11 @@ function fileDrop(e) {
type = e.dataTransfer.files;
}
if(!e.dataTransfer.items) return;
var diff = allSets.length;
loadSVGStatus(true);
for (var i = 0; i < type.length; i++) {
var thisItem = type[i];
if (thisItem.kind === 'file') {
loadSVGStatus(true);
var file = thisItem.getAsFile();
setTimeout(function() {
if(file.name.search(".svg") === -1) {
alert("This file is not an svg! Please select another file.");
loadSVGStatus(false);
@ -150,7 +148,6 @@ function fileDrop(e) {
"calcArray": []
};
allSets.push(oneSet);
if(allSets.length-diff === e.dataTransfer.items.length) updateSidebar();
}
reader.readAsText(file);
if(e.dataTransfer.items) {
@ -158,10 +155,9 @@ function fileDrop(e) {
} else {
e.dataTransfer.clearData();
}
}, 10);
}
}
updateSidebar();
}
function fileDrag(e) {