|
@@ -26,7 +26,6 @@
|
|
|
const SCROLL_DELAY = 50;
|
|
const SCROLL_DELAY = 50;
|
|
|
|
|
|
|
|
window._singleFile_getBoundingClientRect = Element.prototype.getBoundingClientRect;
|
|
window._singleFile_getBoundingClientRect = Element.prototype.getBoundingClientRect;
|
|
|
- window._singleFile_offsetY = window.scrollY;
|
|
|
|
|
Element.prototype.getBoundingClientRect = function () {
|
|
Element.prototype.getBoundingClientRect = function () {
|
|
|
const boundingRect = window._singleFile_getBoundingClientRect.call(this);
|
|
const boundingRect = window._singleFile_getBoundingClientRect.call(this);
|
|
|
const quarterLeft = Math.floor(screen.width / 4);
|
|
const quarterLeft = Math.floor(screen.width / 4);
|
|
@@ -43,7 +42,8 @@
|
|
|
|
|
|
|
|
function scroll(offsetY, maxOffsetY) {
|
|
function scroll(offsetY, maxOffsetY) {
|
|
|
document.documentElement.__defineGetter__("scrollTop", () => offsetY);
|
|
document.documentElement.__defineGetter__("scrollTop", () => offsetY);
|
|
|
- window.scrollY = window.pageYOffset = offsetY;
|
|
|
|
|
|
|
+ document.documentElement.__defineGetter__("scrollY", () => offsetY);
|
|
|
|
|
+ document.documentElement.__defineGetter__("pageYOffset", () => offsetY);
|
|
|
dispatchEvent(new UIEvent("scroll"));
|
|
dispatchEvent(new UIEvent("scroll"));
|
|
|
if (offsetY < maxOffsetY) {
|
|
if (offsetY < maxOffsetY) {
|
|
|
window._singleFile_timeoutScroll = setTimeout(() => scroll(offsetY + SCROLL_LENGTH, maxOffsetY), SCROLL_DELAY);
|
|
window._singleFile_timeoutScroll = setTimeout(() => scroll(offsetY + SCROLL_LENGTH, maxOffsetY), SCROLL_DELAY);
|