const message = this.#getEditor().getHtml();
if (message === "") {
- this.#throwError(this.#textarea, getPhrase("wcf.global.form.error.empty"));
+ this.#throwError(this.#getEditor().element, getPhrase("wcf.global.form.error.empty"));
return false;
}
.dispatch()) as ResponseAddComment;
} catch (error) {
await handleValidationErrors(error, (returnValues) => {
- this.#throwError(this.#textarea, returnValues.errorType);
+ this.#throwError(this.#getEditor().element, returnValues.errorType);
this.#hideLoadingOverlay();
const message = this.#getEditor().getHtml();
if (message === "") {
- this.#throwError(this.#textarea, getPhrase("wcf.global.form.error.empty"));
+ this.#throwError(this.#getEditor().element, getPhrase("wcf.global.form.error.empty"));
return false;
}
if (error instanceof StatusNotOk) {
const json = await error.response.clone().json();
if (json.code === 412 && json.returnValues) {
- this.#throwError(this.#textarea, json.returnValues.errorType);
+ this.#throwError(this.#getEditor().element, json.returnValues.errorType);
}
} else {
throw error;
this.#container.querySelectorAll(".innerError").forEach((el) => el.remove());
const message = this.#getEditor().getHtml();
if (message === "") {
- this.#throwError(this.#textarea, (0, Language_1.getPhrase)("wcf.global.form.error.empty"));
+ this.#throwError(this.#getEditor().element, (0, Language_1.getPhrase)("wcf.global.form.error.empty"));
return false;
}
const data = {
}
catch (error) {
await (0, Ajax_1.handleValidationErrors)(error, (returnValues) => {
- this.#throwError(this.#textarea, returnValues.errorType);
+ this.#throwError(this.#getEditor().element, returnValues.errorType);
this.#hideLoadingOverlay();
return true;
});
this.container.querySelectorAll(".innerError").forEach((el) => el.remove());
const message = this.#getEditor().getHtml();
if (message === "") {
- this.#throwError(this.#textarea, (0, Language_1.getPhrase)("wcf.global.form.error.empty"));
+ this.#throwError(this.#getEditor().element, (0, Language_1.getPhrase)("wcf.global.form.error.empty"));
return false;
}
const data = {
if (error instanceof Error_1.StatusNotOk) {
const json = await error.response.clone().json();
if (json.code === 412 && json.returnValues) {
- this.#throwError(this.#textarea, json.returnValues.errorType);
+ this.#throwError(this.#getEditor().element, json.returnValues.errorType);
}
}
else {
flex-direction: row-reverse;
margin-top: 20px;
}
+
+/* Styling of inline errors for the editor. */
+.ck.ck-editor + .innerError {
+ margin-top: 0;
+ width: 100%;
+
+ &::before {
+ display: none;
+ }
+}