mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-21 22:49:51 -04:00
Paginator: add scroll event
Unlike `relocate`, which is debounced, a scroll event is useful when you want to do stuff as soon as it scrolls.
This commit is contained in:
1 parent
3658b19a86
commit
327031aca1
1 file changed
+1
@@ -503,6 +503,7 @@ export class Paginator extends HTMLElement {
|
||||
this.#footer = this.#root.getElementById('footer')
|
||||
|
||||
this.#observer.observe(this.#container)
|
||||
this.#container.addEventListener('scroll', () => this.dispatchEvent(new Event('scroll')))
|
||||
this.#container.addEventListener('scroll', debounce(() => {
|
||||
if (this.scrolled) {
|
||||
if (this.#justAnchored) this.#justAnchored = false
|
||||
|
||||
Reference in new issue
Block a user