Make everything @typescript-eslint/unbound-method clean
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 30 Oct 2020 11:14:48 +0000 (12:14 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 30 Oct 2020 11:33:41 +0000 (12:33 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts

index 060e4cb53bd35cfae339cf01563b9350748df884..b819a43ac2c0e6c250665bff0815bddc4e2b324b 100644 (file)
@@ -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 = '<span class="icon icon16 fa-arrow-left"></span>';
-        _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 = '<span class="icon icon16 fa-arrow-right"></span>';
-        _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] || "";
index f2bdf658208a65cce1fb278520c571549e5b5d10..06a7bdd8a8f66faf98e9c7ebe5c2adb398624f34 100644 (file)
@@ -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;
index f6ac53e26582389b3831058ba6a5301c259ada6f..0d5c2cb2d1fa3da04f75b340845ada35153ada6e 100644 (file)
@@ -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 = '<span class="icon icon16 fa-arrow-left"></span>';
-  _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 = '<span class="icon icon16 fa-arrow-right"></span>';
-  _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 {
index a29560309cf3239d27df2ff303f05676f66cf6ba..70b8d39617bac8732f9005a1260c8984fbc6bb7c 100644 (file)
@@ -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);