Use custom event for file manager events

This commit is contained in:
2025-04-30 13:21:11 +02:00
parent 553bf604b3
commit 6a45a485e9
8 changed files with 119 additions and 106 deletions

View File

@@ -351,3 +351,18 @@ export const fs_share_path = (path: FSNode[]): string => {
return share_url
}
export const fs_download = (node: FSNode) => {
const a = document.createElement("a")
if (node.type === "file") {
a.href = fs_path_url(node.path) + "?attach"
a.download = node.name
} else if (node.type === "dir") {
a.href = fs_path_url(node.path) + "?bulk_download"
a.download = node.name + ".zip"
}
a.click()
a.remove()
}