mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -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:
@@ -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