_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);
_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);
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] || "";
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;
_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");
_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");
_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 {
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);