slight corrections

This commit is contained in:
MathMan05 2024-08-17 21:27:05 -05:00
parent de41f969ab
commit 66149ac4cd
2 changed files with 6 additions and 6 deletions

View file

@ -29,11 +29,11 @@ class InfiniteScroller {
{
let oldheight = 0;
new ResizeObserver(_ => {
const change = oldheight - this.div.offsetHeight;
if (change > 0) {
const change = oldheight - div.offsetHeight;
if (change > 0 && this.scroll) {
this.scroll.scrollTop += change;
}
oldheight = this.div.offsetHeight;
oldheight = div.offsetHeight;
this.watchForChange();
}).observe(div);
}

View file

@ -30,11 +30,11 @@ class InfiniteScroller{
{
let oldheight=0;
new ResizeObserver(_=>{
const change=oldheight-this.div.offsetHeight;
if(change>0){
const change=oldheight-div.offsetHeight;
if(change>0&&this.scroll){
this.scroll.scrollTop+=change;
}
oldheight=this.div.offsetHeight;
oldheight=div.offsetHeight;
this.watchForChange();
}).observe(div);
}