From c05bfcc2775f0e11db6e856bfcf06d0419c35d54 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 27 Feb 2026 14:40:15 +0100 Subject: ui changed before object slices --- ui/client-scripts/src/pagination.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ui/client-scripts/src/pagination.ts (limited to 'ui/client-scripts/src/pagination.ts') diff --git a/ui/client-scripts/src/pagination.ts b/ui/client-scripts/src/pagination.ts new file mode 100644 index 0000000..380b20e --- /dev/null +++ b/ui/client-scripts/src/pagination.ts @@ -0,0 +1,18 @@ + +globalThis.addEventListener("DOMContentLoaded", () => { + const el = document.querySelector(".next_page") as HTMLElement + if (!el) return + const cont = document.body.parentElement! + console.log(cont); + + cont.addEventListener("scroll", () => { + const end = cont.scrollTop + cont.clientHeight + console.log(end, cont.scrollHeight); + + if (end + 1000 > el.scrollHeight) { + el.textContent = "Loading more..." + el.click() + } + + }) +}) -- cgit v1.3