Skip to content

Commit

Permalink
Update pagetual.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Dec 11, 2024
1 parent ac6e9c9 commit 939b89a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Pagetual/pagetual.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4428,7 +4428,7 @@
}
appendCall(fragment);
if (elements.length) {
requestAnimationFrame(addBatch);
setTimeout(addBatch, 0);
} else resolve();
}
addBatch();
Expand All @@ -4440,12 +4440,13 @@
}

setPageTop(top) {
if (getBody(document).scrollTop) {
if (getBody(document).scrollTop != top) {
let bodyScroll = getBody(document).scrollTop;
if (bodyScroll) {
if (Math.abs(bodyScroll - top) > 50) {
getBody(document).scrollTop = top;
}
} else {
if (document.documentElement.scrollTop != top) {
if (Math.abs(document.documentElement.scrollTop - top) > 50) {
document.documentElement.scrollTop = top;
}
}
Expand Down Expand Up @@ -4484,7 +4485,6 @@
window.scrollTo({ top: targetY, behavior: 'instant'});
targetY = -1;
}
let lastScrollTop = getBody(document).scrollTop || document.documentElement.scrollTop;
this.getInsert();
await this.pageInit(doc, eles);
var self = this, newEles = [];
Expand Down Expand Up @@ -4560,7 +4560,6 @@
await self.insertElement(collection);
}
}
this.setPageTop(lastScrollTop);
this.pageAction(doc, newEles);
let enableHistory = this.curSiteRule.history;
let enableHistoryAfterInsert = false;
Expand Down

0 comments on commit 939b89a

Please sign in to comment.