From 09078989ed39745fd7ff49456e4fefa141a768b9 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Thu, 20 Jun 2024 11:16:19 +0200 Subject: [PATCH] Display of the replace button only if one file can be uploaded --- .../Core/Form/Builder/Field/Controller/FileProcessor.ts | 5 ++++- .../Core/Form/Builder/Field/Controller/FileProcessor.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts index 7a975b77e3..2aa0c626f1 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts @@ -53,7 +53,10 @@ export class FileProcessor { buttons.classList.add(this.classPrefix + "buttons"); this.addDeleteButton(element, buttons); - this.addReplaceButton(element, buttons); + + if (this.#singleFileUpload) { + this.addReplaceButton(element, buttons); + } element.parentElement!.append(buttons); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js index 4e51558888..3ae8036e29 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.js @@ -44,7 +44,9 @@ define(["require", "exports", "WoltLabSuite/Core/Language", "WoltLabSuite/Core/A buttons.classList.add("buttonList"); buttons.classList.add(this.classPrefix + "buttons"); this.addDeleteButton(element, buttons); - this.addReplaceButton(element, buttons); + if (this.#singleFileUpload) { + this.addReplaceButton(element, buttons); + } element.parentElement.append(buttons); } #markElementUploadHasFailed(container, element, reason) { -- 2.20.1