Use `wheneverSeen()` to allow elements being reinitialized
authorAlexander Ebert <ebert@woltlab.com>
Sat, 16 Sep 2023 12:24:46 +0000 (14:24 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 16 Sep 2023 12:24:46 +0000 (14:24 +0200)
ts/WoltLabSuite/Core/Date/Picker.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js

index 6b1572435b5702b60edcd414dbdefb2a71b54df0..2a2b293aa833c6287af81ee82d4d211d2b38408d 100644 (file)
@@ -15,7 +15,7 @@ import UiCloseOverlay from "../Ui/CloseOverlay";
 import DomUtil from "../Dom/Util";
 import { getPageOverlayContainer } from "../Helper/PageOverlay";
 import { createFocusTrap, FocusTrap } from "focus-trap";
-import { wheneverFirstSeen } from "../Helper/Selector";
+import { wheneverSeen } from "../Helper/Selector";
 
 let _didInit = false;
 let _firstDayOfWeek = 0;
@@ -660,7 +660,7 @@ const DatePicker = {
 
     _firstDayOfWeek = parseInt(Language.get("wcf.date.firstDayOfTheWeek"), 10);
 
-    wheneverFirstSeen(
+    wheneverSeen(
       `input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)`,
       (element: HTMLInputElement) => {
         const now = new Date();
index 6a3429622d9b592133c502f8ed4f1964da08924a..f36eaf956eb9e88a3e9b1635893779c75e91ccfd 100644 (file)
@@ -543,7 +543,7 @@ define(["require", "exports", "tslib", "../Core", "./Util", "../Event/Handler",
             }
             _didInit = true;
             _firstDayOfWeek = parseInt(Language.get("wcf.date.firstDayOfTheWeek"), 10);
-            (0, Selector_1.wheneverFirstSeen)(`input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)`, (element) => {
+            (0, Selector_1.wheneverSeen)(`input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)`, (element) => {
                 const now = new Date();
                 element.classList.add("inputDatePicker");
                 element.readOnly = true;