diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-27 14:40:15 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-27 14:40:15 +0100 |
| commit | c05bfcc2775f0e11db6e856bfcf06d0419c35d54 (patch) | |
| tree | ffd0e9fcf6b476a6198287085a514cfa7940c200 /ui/client-scripts/src | |
| parent | 4ba86694e393c61107e27c4127efc0455b329524 (diff) | |
| download | jellything-c05bfcc2775f0e11db6e856bfcf06d0419c35d54.tar jellything-c05bfcc2775f0e11db6e856bfcf06d0419c35d54.tar.bz2 jellything-c05bfcc2775f0e11db6e856bfcf06d0419c35d54.tar.zst | |
ui changed before object slices
Diffstat (limited to 'ui/client-scripts/src')
| -rw-r--r-- | ui/client-scripts/src/main.ts | 1 | ||||
| -rw-r--r-- | ui/client-scripts/src/pagination.ts | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/ui/client-scripts/src/main.ts b/ui/client-scripts/src/main.ts index 303ac71..ba60646 100644 --- a/ui/client-scripts/src/main.ts +++ b/ui/client-scripts/src/main.ts @@ -10,3 +10,4 @@ import "./backbutton.ts" import "./dangerbutton.ts" import "./log_live.ts" import "./import_live.ts" +import "./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() + } + + }) +}) |