From 07af806166a475b3a1465a37aba1b8321ad51d91 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 26 Jun 2024 11:12:29 +0200 Subject: [PATCH] Move statement to the correct comment position --- .../Core/Form/Builder/Field/Controller/FileProcessor.ts | 2 +- .../Core/Form/Builder/Field/Controller/FileProcessor.js | 2 +- 2 files changed, 2 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 7f0253353c..8661f6b935 100644 --- a/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts +++ b/ts/WoltLabSuite/Core/Form/Builder/Field/Controller/FileProcessor.ts @@ -156,7 +156,6 @@ export class FileProcessor { replaceButton.classList.add("button", "small"); replaceButton.textContent = getPhrase("wcf.global.button.replace"); replaceButton.addEventListener("click", () => { - this.#replaceElement = element; // add to context an extra attribute that the replace button is clicked. // after the dialog is closed or the file is selected, the context will be reset to his old value. // this is necessary as the serverside validation will otherwise fail. @@ -168,6 +167,7 @@ export class FileProcessor { // remove the element and all buttons from the dom, but keep them stored in a variable. // if the user cancels the dialog or the upload fails, reinsert the old elements and show an error message. // if the upload is successful, delete the old file. + this.#replaceElement = element; this.#unregisterFile(element); const changeEventListener = () => { 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 756b1a7b80..94700a0ca4 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 @@ -121,7 +121,6 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui replaceButton.classList.add("button", "small"); replaceButton.textContent = (0, Language_1.getPhrase)("wcf.global.button.replace"); replaceButton.addEventListener("click", () => { - this.#replaceElement = element; // add to context an extra attribute that the replace button is clicked. // after the dialog is closed or the file is selected, the context will be reset to his old value. // this is necessary as the serverside validation will otherwise fail. @@ -132,6 +131,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Language", "WoltLabSui // remove the element and all buttons from the dom, but keep them stored in a variable. // if the user cancels the dialog or the upload fails, reinsert the old elements and show an error message. // if the upload is successful, delete the old file. + this.#replaceElement = element; this.#unregisterFile(element); const changeEventListener = () => { this.#uploadButton.dataset.context = oldContext; -- 2.20.1