fix edit URL for files inside of directories

This commit is contained in:
foamyguy 2022-08-01 21:56:11 -05:00
parent 664cadc3ac
commit da8451b7cc

View File

@ -63,6 +63,7 @@ async function refresh_list() {
var icon = "⬇"; var icon = "⬇";
var file_path = current_path + f.name; var file_path = current_path + f.name;
let api_url = new URL("/fs" + file_path, url_base); let api_url = new URL("/fs" + file_path, url_base);
let edit_url = "/edit/#" + file_path;
if (f.directory) { if (f.directory) {
file_path = "#" + file_path + "/"; file_path = "#" + file_path + "/";
api_url += "/"; api_url += "/";
@ -91,7 +92,7 @@ async function refresh_list() {
delete_button.disabled = !editable; delete_button.disabled = !editable;
delete_button.onclick = del; delete_button.onclick = del;
let edit_url = new URL("/edit/#" + f.name, url_base); edit_url = new URL(edit_url, url_base);
let edit_link = clone.querySelector(".edit_link"); let edit_link = clone.querySelector(".edit_link");
edit_link.href = edit_url edit_link.href = edit_url