Skip to content

Commit

Permalink
fix handling of relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Jul 15, 2019
1 parent e98f05e commit 47ef115
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,23 @@ var filesize = 0;

drop.on('addedfile', function(file) {
// console.log(file);
var domain = document.getElementById("inputDomain").value
var domain = document.getElementById("inputDomain").value;
files.push(file);
if (file.hasOwnProperty("webkitRelativePath")) {
if (files.length == 1) {
if ("webkitRelativePath" in file) {
if (files.length == 1 && file.webkitRelativePath != "") {
relativeDirectory = file.webkitRelativePath.split("/")[0];
} else if (file.webkitRelativePath.split("/")[0] != relativeDirectory) {
relativeDirectory = "";
}
}
if ("fullPath" in file) {
if (files.length == 1 && file.fullPath != "") {
relativeDirectory = file.fullPath.split("/")[0];
} else if (file.fullPath.split("/")[0] != relativeDirectory) {
relativeDirectory = "";
}
}



if (!(isConnected)) {
Expand Down

0 comments on commit 47ef115

Please sign in to comment.