Merge pull request #6680 from FoamyGuy/edit_url_fix

fix edit URL for files inside of directories
This commit is contained in:
Scott Shawcroft 2022-08-02 10:54:19 -07:00 committed by GitHub
commit cb2e1e0064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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