Consolidation 1

This commit is contained in:
Gogs
2026-07-09 15:35:20 +02:00
parent 558bd4ff6f
commit ca13c7620a
5 changed files with 54 additions and 52 deletions
+21 -1
View File
@@ -192,7 +192,27 @@ function dashboardUpdateCard(card, item) {
bar.style.width = `${TVGuideLive.calcPercent(item.start, item.stop)}%`;
}
card.dataset.programmeId = `${item.channel_id}-${item.start}-${item.title}`;
const id = `${item.channel_id}-${item.start}-${item.title}`;
card.dataset.programmeId = id;
window.TVGUIDE_PROGRAMMES = window.TVGUIDE_PROGRAMMES || {};
window.TVGUIDE_PROGRAMMES[id] = {
id,
channel_id: item.channel_id,
channel: item.channel_name,
channel_number: item.channel_number,
favorite: item.favorite,
title: item.title,
subtitle: item.subtitle || '',
description: item.description || '',
category: item.category || '',
metadata: item.metadata || {},
year: item.year || '',
rating: item.rating || '',
country: item.country || '',
start: TVGuideLive.formatTime(item.start),
stop: TVGuideLive.formatTime(item.stop)
};
}
function dashboardRender(grid, items) {
+9 -2
View File
@@ -85,10 +85,17 @@ export function initProgrammeModal() {
document.body.classList.remove("modal-open");
};
document.querySelectorAll(".timeline-programme, .dashboard-programme").forEach((programme) => {
programme.addEventListener("click", () => openModal(programme));
document.addEventListener("click", (event) => {
const programme = event.target.closest(".timeline-programme, .dashboard-programme");
if (!programme) {
return;
}
openModal(programme);
});
modal.querySelectorAll("[data-modal-close]").forEach((element) => {
element.addEventListener("click", closeModal);
});