Make results thumbnails clickable for lightbox
This commit is contained in:
@@ -177,7 +177,7 @@ function renderResults() {
|
|||||||
row.innerHTML = `
|
row.innerHTML = `
|
||||||
<td>${idx + 1}</td>
|
<td>${idx + 1}</td>
|
||||||
<td class="game-cell">
|
<td class="game-cell">
|
||||||
${r.screenshotUrl ? `<img class="thumb" src="${r.screenshotUrl}" alt="${r.name}">` : ''}
|
${r.screenshotUrl ? `<img class="thumb clickable-thumb" src="${r.screenshotUrl}" alt="${r.name}">` : ''}
|
||||||
<div class="game-meta">
|
<div class="game-meta">
|
||||||
<div class="title-line">${r.name}</div>
|
<div class="title-line">${r.name}</div>
|
||||||
${r.genre ? `<div class="muted small">${r.genre}</div>` : ''}
|
${r.genre ? `<div class="muted small">${r.genre}</div>` : ''}
|
||||||
@@ -194,6 +194,9 @@ function renderResults() {
|
|||||||
tbody.appendChild(row);
|
tbody.appendChild(row);
|
||||||
});
|
});
|
||||||
container.appendChild(table);
|
container.appendChild(table);
|
||||||
|
container.querySelectorAll(".clickable-thumb").forEach(img => {
|
||||||
|
img.addEventListener("click", () => openLightbox(img.src, img.alt));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupHandlers() {
|
function setupHandlers() {
|
||||||
|
|||||||
Reference in New Issue
Block a user