file drop sidebar update
This commit is contained in:
parent
4917e87b65
commit
21faf348f7
8
main.js
8
main.js
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user