- ${defaultVisibleEvents.join("")}
- ${defaultHiddenEvents.length > 0 ? `
-
-
- Show more warning events (${defaultHiddenEvents.length})
-
-
- Show less warning events
-
+
+
+
+ There are warning events (${events.length}).
+ Show all events.
+ Hide all events.
+
+
+
+ ${events.map(event => `- ${event.message}
`).join("")}
+
- ` : ""}
+
`).querySelector("div");
- eventsContainer.replaceChildren(eventsMessages);
- if (defaultHiddenEvents.length > 0) {
- const hiddenEventsElement = eventsMessages.querySelector(`div[data-role="hidden-events"]`);
- const showMoreEventsElement = eventsMessages.querySelector(`div[data-role="show-more-events"]`);
- const showLessEventsElement = eventsMessages.querySelector(`div[data-role="show-less-events"]`);
- // Show more events click
- showMoreEventsElement.addEventListener("click", () => {
- hiddenEventsElement.style.display = "block";
- showLessEventsElement.style.display = "inline-block";
- showMoreEventsElement.style.display = "none";
- });
- // Show less events click
- showLessEventsElement.addEventListener("click", () => {
- hiddenEventsElement.style.display = "none";
- showLessEventsElement.style.display = "none";
- showMoreEventsElement.style.display = "inline-block";
- });
- }
+ eventsContainer.replaceChildren(eventsContent);
+ const eventsElement = eventsContent.querySelector(`div[data-role="events"]`);
+ const showEventsElement = eventsContent.querySelector(`span[data-role="show-events"]`);
+ const hideEventsElement = eventsContent.querySelector(`span[data-role="hide-events"]`);
+ // Show events click
+ showEventsElement.addEventListener("click", () => {
+ eventsElement.style.display = "";
+ hideEventsElement.style.display = "";
+ showEventsElement.style.display = "none";
+ });
+ // Hide events click
+ hideEventsElement.addEventListener("click", () => {
+ eventsElement.style.display = "none";
+ hideEventsElement.style.display = "none";
+ showEventsElement.style.display = "";
+ });
}
}
}