MCPcopy Create free account
hub / github.com/Forward-Future/loopy / focusFirstVisibleLoop

Function focusFirstVisibleLoop

loop-library/site/script.js:366–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364 applySort(params.get("sort") ?? "featured");
365
366 const requestedPage = Number.parseInt(params.get("page") ?? "1", 10);
367 currentPage =
368 Number.isInteger(requestedPage) && requestedPage > 0 ? requestedPage : 1;
369}
370
371function focusFirstVisibleLoop() {
372 const firstVisibleTitle = loopRows
373 .find((row) => !row.hidden)
374 ?.querySelector(".loop-title-link");
375
376 if (!firstVisibleTitle) {
377 return;
378 }
379
380 window.requestAnimationFrame(() => {
381 window.requestAnimationFrame(() => {
382 firstVisibleTitle.focus({ preventScroll: true });
383 firstVisibleTitle.scrollIntoView({ behavior: "instant", block: "start" });
384 });

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected