Consolidation 1
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user