mirror of
https://github.com/schollz/hostyoself.git
synced 2026-01-22 18:06:16 +00:00
fix handling of relative path
This commit is contained in:
parent
e98f05e6dc
commit
47ef115491
1 changed files with 11 additions and 3 deletions
14
static/main.js
vendored
14
static/main.js
vendored
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue