aboutsummaryrefslogtreecommitdiff
path: root/ui/client-scripts/src/pagination.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-27 14:40:15 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-27 14:40:15 +0100
commitc05bfcc2775f0e11db6e856bfcf06d0419c35d54 (patch)
treeffd0e9fcf6b476a6198287085a514cfa7940c200 /ui/client-scripts/src/pagination.ts
parent4ba86694e393c61107e27c4127efc0455b329524 (diff)
downloadjellything-c05bfcc2775f0e11db6e856bfcf06d0419c35d54.tar
jellything-c05bfcc2775f0e11db6e856bfcf06d0419c35d54.tar.bz2
jellything-c05bfcc2775f0e11db6e856bfcf06d0419c35d54.tar.zst
ui changed before object slices
Diffstat (limited to 'ui/client-scripts/src/pagination.ts')
-rw-r--r--ui/client-scripts/src/pagination.ts18
1 files changed, 18 insertions, 0 deletions
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()
+ }
+
+ })
+})