From a5154c60012be873bf2e2e63b7eba48a3064f282 Mon Sep 17 00:00:00 2001 From: davrot Date: Sat, 25 Jan 2025 21:12:42 +0000 Subject: [PATCH] =?UTF-8?q?Dateien=20nach=20=E2=80=9Eweb=5Fsrc/js/features?= =?UTF-8?q?=E2=80=9C=20hochladen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/js/features/common-global.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index b05f6e07fe..4ae4ff9a77 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -229,7 +229,8 @@ export function initDropzone(el) { this.on('success', (file, data) => { file.uuid = data.uuid; const $input = $(``).val(data.uuid); - $dropzone.find('.files').append($input); + const $inputPath = $(``); + $dropzone.find('.files').append($input).append($inputPath); // Create a "Copy Link" element, to conveniently copy the image // or file link as Markdown to the clipboard const copyLinkElement = document.createElement('div'); @@ -250,7 +251,12 @@ export function initDropzone(el) { file.previewTemplate.append(copyLinkElement); }); this.on('removedfile', (file) => { + // Remove the hidden input for the file $(`#${file.uuid}`).remove(); + + // Remove the hidden input for files_fullpath + $(`input[name="files_fullpath[${file.uuid}]"]`).remove(); + if ($dropzone.data('remove-url')) { POST($dropzone.data('remove-url'), { data: new URLSearchParams({file: file.uuid}),