From: Tim Düsterhus Date: Fri, 30 Oct 2020 11:14:48 +0000 (+0100) Subject: Make everything @typescript-eslint/unbound-method clean X-Git-Tag: 5.4.0_Alpha_1~666^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bc6446d5581572343caa2808ae61ba80b9dbc0d6;p=GitHub%2FWoltLab%2FWCF.git Make everything @typescript-eslint/unbound-method clean --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js index 060e4cb53b..b819a43ac2 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js @@ -55,7 +55,7 @@ define(["require", "exports", "tslib", "../Core", "./Util", "../Dom/Change/Liste _dateMonthPrevious.title = Language.get("wcf.date.datePicker.previousMonth"); _dateMonthPrevious.setAttribute("aria-label", Language.get("wcf.date.datePicker.previousMonth")); _dateMonthPrevious.innerHTML = ''; - _dateMonthPrevious.addEventListener("click", DatePicker.previousMonth); + _dateMonthPrevious.addEventListener("click", (ev) => DatePicker.previousMonth(ev)); header.appendChild(_dateMonthPrevious); const monthYearContainer = document.createElement("span"); header.appendChild(monthYearContainer); @@ -85,7 +85,7 @@ define(["require", "exports", "tslib", "../Core", "./Util", "../Dom/Change/Liste _dateMonthNext.title = Language.get("wcf.date.datePicker.nextMonth"); _dateMonthNext.setAttribute("aria-label", Language.get("wcf.date.datePicker.nextMonth")); _dateMonthNext.innerHTML = ''; - _dateMonthNext.addEventListener("click", DatePicker.nextMonth); + _dateMonthNext.addEventListener("click", (ev) => DatePicker.nextMonth(ev)); header.appendChild(_dateMonthNext); _dateGrid = document.createElement("ul"); _datePicker.appendChild(_dateGrid); @@ -185,8 +185,8 @@ define(["require", "exports", "tslib", "../Core", "./Util", "../Dom/Change/Liste return; _didInit = true; _firstDayOfWeek = parseInt(Language.get("wcf.date.firstDayOfTheWeek"), 10); - Listener_1.default.add("WoltLabSuite/Core/Date/Picker", DatePicker.init); - CloseOverlay_1.default.add("WoltLabSuite/Core/Date/Picker", close); + Listener_1.default.add("WoltLabSuite/Core/Date/Picker", () => DatePicker.init()); + CloseOverlay_1.default.add("WoltLabSuite/Core/Date/Picker", () => close()); } function getDateValue(attributeName) { let date = _input.dataset[attributeName] || ""; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js index f2bdf65820..06a7bdd8a8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js @@ -299,8 +299,8 @@ define(["require", "exports", "tslib", "../../CallbackList", "../../Core", "../. document.body.appendChild(_menuContainer); _availableDropdowns = document.getElementsByClassName("dropdownToggle"); UiDropdownSimple.initAll(); - CloseOverlay_1.default.add("WoltLabSuite/Core/Ui/Dropdown/Simple", UiDropdownSimple.closeAll); - Listener_1.default.add("WoltLabSuite/Core/Ui/Dropdown/Simple", UiDropdownSimple.initAll); + CloseOverlay_1.default.add("WoltLabSuite/Core/Ui/Dropdown/Simple", () => UiDropdownSimple.closeAll()); + Listener_1.default.add("WoltLabSuite/Core/Ui/Dropdown/Simple", () => UiDropdownSimple.initAll()); document.addEventListener("scroll", onScroll); // expose on window object for backward compatibility window.bc_wcfSimpleDropdown = this; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts index f6ac53e265..0d5c2cb2d1 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts @@ -61,7 +61,7 @@ function createPicker() { _dateMonthPrevious.title = Language.get("wcf.date.datePicker.previousMonth"); _dateMonthPrevious.setAttribute("aria-label", Language.get("wcf.date.datePicker.previousMonth")); _dateMonthPrevious.innerHTML = ''; - _dateMonthPrevious.addEventListener("click", DatePicker.previousMonth); + _dateMonthPrevious.addEventListener("click", (ev) => DatePicker.previousMonth(ev)); header.appendChild(_dateMonthPrevious); const monthYearContainer = document.createElement("span"); @@ -96,7 +96,7 @@ function createPicker() { _dateMonthNext.title = Language.get("wcf.date.datePicker.nextMonth"); _dateMonthNext.setAttribute("aria-label", Language.get("wcf.date.datePicker.nextMonth")); _dateMonthNext.innerHTML = ''; - _dateMonthNext.addEventListener("click", DatePicker.nextMonth); + _dateMonthNext.addEventListener("click", (ev) => DatePicker.nextMonth(ev)); header.appendChild(_dateMonthNext); _dateGrid = document.createElement("ul"); @@ -216,8 +216,8 @@ function setup() { _firstDayOfWeek = parseInt(Language.get("wcf.date.firstDayOfTheWeek"), 10); - DomChangeListener.add("WoltLabSuite/Core/Date/Picker", DatePicker.init); - UiCloseOverlay.add("WoltLabSuite/Core/Date/Picker", close); + DomChangeListener.add("WoltLabSuite/Core/Date/Picker", () => DatePicker.init()); + UiCloseOverlay.add("WoltLabSuite/Core/Date/Picker", () => close()); } function getDateValue(attributeName: string): Date { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts index a29560309c..70b8d39617 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts @@ -351,8 +351,8 @@ const UiDropdownSimple = { UiDropdownSimple.initAll(); - UiCloseOverlay.add("WoltLabSuite/Core/Ui/Dropdown/Simple", UiDropdownSimple.closeAll); - DomChangeListener.add("WoltLabSuite/Core/Ui/Dropdown/Simple", UiDropdownSimple.initAll); + UiCloseOverlay.add("WoltLabSuite/Core/Ui/Dropdown/Simple", () => UiDropdownSimple.closeAll()); + DomChangeListener.add("WoltLabSuite/Core/Ui/Dropdown/Simple", () => UiDropdownSimple.initAll()); document.addEventListener("scroll", onScroll);