mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
Move file dialog - Testing
This commit is contained in:
parent
267203bec9
commit
64520a75c5
@ -317,7 +317,7 @@ listing.addDoubleTapEvent = function () {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
touches.count = 0;
|
touches.count = 0;
|
||||||
}, 500)
|
}, 300)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -377,7 +377,7 @@ function loadNextFolder(event) {
|
|||||||
prompt = document.querySelector("form.prompt.active");
|
prompt = document.querySelector("form.prompt.active");
|
||||||
|
|
||||||
prompt.addEventListener("submit", moveSelected);
|
prompt.addEventListener("submit", moveSelected);
|
||||||
|
console.log(event);
|
||||||
request.open("GET", event.target.dataset.url);
|
request.open("GET", event.target.dataset.url);
|
||||||
request.setRequestHeader("Accept", "application/json");
|
request.setRequestHeader("Accept", "application/json");
|
||||||
request.send();
|
request.send();
|
||||||
@ -388,11 +388,23 @@ function loadNextFolder(event) {
|
|||||||
prompt.querySelector("ul").innerHTML = "";
|
prompt.querySelector("ul").innerHTML = "";
|
||||||
prompt.querySelector('code').innerHTML = event.target.dataset.url;
|
prompt.querySelector('code').innerHTML = event.target.dataset.url;
|
||||||
|
|
||||||
|
if(prompt.querySelector('code').innerHTML != baseURL + "/") {
|
||||||
|
let newNode = document.createElement("li");
|
||||||
|
newNode.dataset.url = removeLastDirectoryPartOf(event.target.dataset.url) + "/";
|
||||||
|
newNode.innerHTML = "..";
|
||||||
|
newNode.setAttribute("aria-selected", false);
|
||||||
|
newNode.addEventListener("dblclick", loadNextFolder);
|
||||||
|
newNode.addEventListener("click", selectMoveFolder);
|
||||||
|
|
||||||
|
prompt.querySelector("div.file-list ul").appendChild(newNode);
|
||||||
|
}
|
||||||
|
|
||||||
if(JSON.parse(request.response) == null) {
|
if(JSON.parse(request.response) == null) {
|
||||||
prompt.querySelector("p").innerHTML = `There aren't any folders in this directory.`;
|
prompt.querySelector("p").innerHTML = `There aren't any folders in this directory.`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(let f of JSON.parse(request.response)) {
|
for(let f of JSON.parse(request.response)) {
|
||||||
if(f.IsDir === true) {
|
if(f.IsDir === true) {
|
||||||
dirs++;
|
dirs++;
|
||||||
@ -457,6 +469,17 @@ function moveEvent(event) {
|
|||||||
prompt.querySelector("form").addEventListener("submit", moveSelected);
|
prompt.querySelector("form").addEventListener("submit", moveSelected);
|
||||||
prompt.querySelector('code').innerHTML = window.location.pathname;
|
prompt.querySelector('code').innerHTML = window.location.pathname;
|
||||||
|
|
||||||
|
if(window.location.pathname !== baseURL + "/") {
|
||||||
|
let newNode = document.createElement("li");
|
||||||
|
newNode.dataset.url = removeLastDirectoryPartOf(window.location.pathname) + "/";
|
||||||
|
newNode.innerHTML = "..";
|
||||||
|
newNode.setAttribute("aria-selected", false);
|
||||||
|
newNode.addEventListener("dblclick", loadNextFolder);
|
||||||
|
newNode.addEventListener("click", selectMoveFolder);
|
||||||
|
|
||||||
|
prompt.querySelector("div.file-list ul").appendChild(newNode);
|
||||||
|
}
|
||||||
|
|
||||||
for(let f of JSON.parse(request.response)) {
|
for(let f of JSON.parse(request.response)) {
|
||||||
if(f.IsDir === true) {
|
if(f.IsDir === true) {
|
||||||
dirs++;
|
dirs++;
|
||||||
|
Loading…
Reference in New Issue
Block a user