From: Cyperghost Date: Wed, 26 Jun 2024 09:12:29 +0000 (+0200) Subject: Move statement to the correct comment position X-Git-Tag: 6.1.0_Alpha_1~41^2~18 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=07af806166a475b3a1465a37aba1b8321ad51d91;p=GitHub%2FWoltLab%2FWCF.git Move statement to the correct comment position --- 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;