From: joshuaruesweg Date: Fri, 1 Jan 2021 12:16:27 +0000 (+0100) Subject: Fix JS for upload form fields X-Git-Tag: 5.4.0_Alpha_1~497^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f152c78b021dae0ab37abdf6411b9e251c15ac26;p=GitHub%2FWoltLab%2FWCF.git Fix JS for upload form fields --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js index 97f1a129ee..3038ca1c87 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js @@ -26,6 +26,10 @@ define(["require", "exports", "tslib", "../../Core", "./Delete", "../../Dom/Util imagePreview: false, // max files maxFiles: null, + // Dummy value, because it is checked in the base method, without using it with this upload handler. + className: "invalid", + // url + url: `index.php?ajax-file-upload/&t=${window.SECURITY_TOKEN}`, }, options); options.multiple = options.maxFiles === null || options.maxFiles > 1; super(buttonContainerId, targetId, options); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/File/Upload.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/File/Upload.ts index d8ab9f7d04..24cb0b17ea 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/File/Upload.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/File/Upload.ts @@ -59,6 +59,10 @@ class FileUpload extends Upload implements FileUploadHandler imagePreview: false, // max files maxFiles: null, + // Dummy value, because it is checked in the base method, without using it with this upload handler. + className: "invalid", + // url + url: `index.php?ajax-file-upload/&t=${window.SECURITY_TOKEN}`, }, options, );