From 484f7d9af0b2311b2c6deda4c5bd0aba5af09019 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 29 Nov 2020 20:46:18 +0100 Subject: [PATCH] Resolved some minor issues --- .../WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.js | 8 ++++---- .../js/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.js | 2 +- .../WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.ts | 10 +++++----- .../ts/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.ts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.js index e409109567..a2c0ed6500 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.js @@ -27,10 +27,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Dom/Util", ".. if (methods.length === 0) { return; } - if (smtpCheckbox) { - this.onChange(smtpCheckbox); - } - this.container = document.createElement("div"); + this.container = document.createElement("dl"); this.container.innerHTML = `
${Language.get("wcf.acp.email.smtp.test")}
${Language.get("wcf.acp.email.smtp.test.run")} @@ -38,6 +35,9 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Dom/Util", "..
`; this.buttonRunTest = this.container.querySelector("a"); this.buttonRunTest.addEventListener("click", (ev) => this.onClick(ev)); + if (smtpCheckbox) { + this.onChange(smtpCheckbox); + } } onChange(checkbox) { if (checkbox.value === "smtp" && checkbox.checked) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.js index 3d5969d868..8818a052d8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.js @@ -81,7 +81,7 @@ define(["require", "exports", "tslib", "../../../Ajax/Request", "../../../Langua }); }); const results = await Promise.all(tests.map((test) => test.catch((result) => result))); - const passed = results.some((result) => !result.pass); + const passed = !results.some((result) => !result.pass); // Delay the status update to prevent UI flicker. await new Promise((resolve) => window.setTimeout(resolve, 500)); if (passed) { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.ts index d6e9ecefed..9be7ad96bf 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/EmailSmtpTest.ts @@ -39,11 +39,7 @@ class EmailSmtpTest implements AjaxCallbackObject { return; } - if (smtpCheckbox) { - this.onChange(smtpCheckbox); - } - - this.container = document.createElement("div"); + this.container = document.createElement("dl"); this.container.innerHTML = `
${Language.get("wcf.acp.email.smtp.test")}
${Language.get("wcf.acp.email.smtp.test.run")} @@ -52,6 +48,10 @@ class EmailSmtpTest implements AjaxCallbackObject { this.buttonRunTest = this.container.querySelector("a")!; this.buttonRunTest.addEventListener("click", (ev) => this.onClick(ev)); + + if (smtpCheckbox) { + this.onChange(smtpCheckbox); + } } private onChange(checkbox: HTMLInputElement): void { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.ts index 15eab7bab9..57b981993f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Acp/Ui/Option/RewriteTest.ts @@ -103,7 +103,7 @@ class RewriteTest { const results: TestResult[] = await Promise.all(tests.map((test) => test.catch((result) => result))); - const passed = results.some((result) => !result.pass); + const passed = !results.some((result) => !result.pass); // Delay the status update to prevent UI flicker. await new Promise((resolve) => window.setTimeout(resolve, 500)); -- 2.20.1