forked from mirror/misskey
Update scroll.ts
This commit is contained in:
parent
ee22820da2
commit
eb81813ebf
@ -45,7 +45,7 @@ export function onScrollTop(el: HTMLElement, cb: () => unknown, tolerance = 1, o
|
|||||||
|
|
||||||
const container = getScrollContainer(el) ?? window;
|
const container = getScrollContainer(el) ?? window;
|
||||||
|
|
||||||
const onScroll = ev => {
|
const onScroll = () => {
|
||||||
if (!document.body.contains(el)) return;
|
if (!document.body.contains(el)) return;
|
||||||
if (isTopVisible(el, tolerance)) {
|
if (isTopVisible(el, tolerance)) {
|
||||||
cb();
|
cb();
|
||||||
@ -69,7 +69,7 @@ export function onScrollBottom(el: HTMLElement, cb: () => unknown, tolerance = 1
|
|||||||
}
|
}
|
||||||
|
|
||||||
const containerOrWindow = container ?? window;
|
const containerOrWindow = container ?? window;
|
||||||
const onScroll = ev => {
|
const onScroll = () => {
|
||||||
if (!document.body.contains(el)) return;
|
if (!document.body.contains(el)) return;
|
||||||
if (isBottomVisible(el, 1, container)) {
|
if (isBottomVisible(el, 1, container)) {
|
||||||
cb();
|
cb();
|
||||||
|
Loading…
Reference in New Issue
Block a user