From 05a006facac8e0b5017cfaecea5f618d55e6be9d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 8 Apr 2025 23:33:57 +0300 Subject: [PATCH] fix(calendar_view): add back note icon --- .../app/widgets/view_widgets/calendar_view.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/public/app/widgets/view_widgets/calendar_view.ts b/src/public/app/widgets/view_widgets/calendar_view.ts index f05e247ad..231df60dc 100644 --- a/src/public/app/widgets/view_widgets/calendar_view.ts +++ b/src/public/app/widgets/view_widgets/calendar_view.ts @@ -158,6 +158,27 @@ export default class CalendarView extends ViewMode { eventDidMount: (e) => { const { iconClass, promotedAttributes } = e.event.extendedProps; + // Prepend the icon to the title, if any. + if (iconClass) { + let titleContainer; + switch (e.view.type) { + case "timeGridWeek": + case "dayGridMonth": + titleContainer = e.el.querySelector(".fc-event-title"); + break; + case "multiMonthYear": + break; + case "listMonth": + titleContainer = e.el.querySelector(".fc-list-event-title a"); + break; + } + + if (titleContainer) { + const icon = /*html*/` `; + titleContainer.insertAdjacentHTML("afterbegin", icon); + } + } + // Append promoted attributes to the end of the event container. if (promotedAttributes) { let promotedAttributesHtml = "";