From 3bfd66d6cc59f672c91f2b2631583947e7cc67de Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 6 Dec 2020 14:56:02 +0100 Subject: [PATCH] Fix some eslint issues in form builder code --- .../files/js/WoltLabSuite/Core/Form/Builder/Dialog.js | 4 ++-- .../files/ts/WoltLabSuite/Core/Form/Builder/Dialog.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js index a52823d536..27351c1d9b 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Dialog.js @@ -24,7 +24,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Ui/Dialog", "../../A this._options = Core.extend({ actionParameters: {}, destroyOnClose: false, - usesDboAction: this._className.match(/\w+\\data\\/), + usesDboAction: new RegExp(/\w+\\data\\/).test(this._className), }, options); this._options.dialog = Core.extend(this._options.dialog || {}, { onClose: this._dialogOnClose.bind(this), @@ -117,7 +117,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Ui/Dialog", "../../A } this._additionalSubmitButtons = Array.from(dialogData.content.querySelectorAll(':not(.formSubmit) button[type="submit"]')); this._additionalSubmitButtons.forEach((submit) => { - submit.addEventListener("click", (ev) => { + submit.addEventListener("click", () => { // Mark the button that was clicked so that the button data handlers know // which data needs to be submitted. this._additionalSubmitButtons.forEach((button) => { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Dialog.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Dialog.ts index 580a20645b..1fe3a786fe 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Dialog.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Form/Builder/Dialog.ts @@ -10,7 +10,7 @@ import * as Core from "../../Core"; import UiDialog from "../../Ui/Dialog"; -import { DialogCallbackObject, DialogCallbackSetup, DialogData, DialogOptions } from "../../Ui/Dialog/Data"; +import { DialogCallbackObject, DialogCallbackSetup, DialogData } from "../../Ui/Dialog/Data"; import * as Ajax from "../../Ajax"; import { AjaxCallbackObject, AjaxCallbackSetup, DatabaseObjectActionResponse, RequestOptions } from "../../Ajax/Data"; import FormBuilderManager from "./Manager"; @@ -46,7 +46,7 @@ class FormBuilderDialog implements AjaxCallbackObject, DialogCallbackObject { { actionParameters: {}, destroyOnClose: false, - usesDboAction: this._className.match(/\w+\\data\\/), + usesDboAction: new RegExp(/\w+\\data\\/).test(this._className), }, options, ) as FormBuilderDialogOptions; @@ -164,7 +164,7 @@ class FormBuilderDialog implements AjaxCallbackObject, DialogCallbackObject { dialogData.content.querySelectorAll(':not(.formSubmit) button[type="submit"]'), ); this._additionalSubmitButtons.forEach((submit) => { - submit.addEventListener("click", (ev) => { + submit.addEventListener("click", () => { // Mark the button that was clicked so that the button data handlers know // which data needs to be submitted. this._additionalSubmitButtons.forEach((button) => { @@ -205,7 +205,7 @@ class FormBuilderDialog implements AjaxCallbackObject, DialogCallbackObject { /** * Destroys the dialog form. */ - public destroy(ignoreDialog: boolean = false): void { + public destroy(ignoreDialog = false): void { if (this._formId !== "") { if (FormBuilderManager.hasForm(this._formId)) { FormBuilderManager.unregisterForm(this._formId); @@ -231,7 +231,7 @@ class FormBuilderDialog implements AjaxCallbackObject, DialogCallbackObject { /** * Opens the dialog form. */ - public open() { + public open(): void { if (UiDialog.getDialog(this._dialogId)) { UiDialog.open(this); } else { -- 2.20.1