feat: portfolio/about listings start locked on their first file

same end state as clicking the first row by hand — hovering other rows no longer steals the preview until you actually click one. clicking a different row still jumps straight to it and relocks there; clicking the locked row again releases it back to hover-browsing. games are excluded (nothing to browse), matched via the game-embed class rather than page context so it stays correct no matter which page a game was launched from.
This commit is contained in:
kgva CMS
2026-08-11 19:03:17 +00:00
parent f318ef9a2f
commit 5c5b267a7f
+3
View File
@@ -85,6 +85,9 @@
var start = rows.findIndex(function (a) { return a.classList.contains("is-selected"); });
select(start < 0 ? 0 : start, true); // initial selection: don't echo into the shell yet
// portfolio/about listings start pre-locked on their first file, same as a
// manual click — games stay hover-driven, there's nothing else to browse there
if (container && !container.classList.contains("game-embed")) setFrozen(true);
// warm the cache so switching between gallery images is instant
var srcs = rows.map(function (a) { return a.getAttribute("data-img"); }).filter(Boolean);