1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Replace the deprecated window.pageYOffset with window.scollY

See https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
This commit is contained in:
jvoisin 2025-01-20 15:44:29 +01:00 committed by Frédéric Guillot
parent 3cd448099d
commit aa56d23551

View file

@ -11,7 +11,7 @@ class DomHelper {
} }
static scrollPageTo(element, evenIfOnScreen) { static scrollPageTo(element, evenIfOnScreen) {
const windowScrollPosition = window.pageYOffset; const windowScrollPosition = window.scrollY;
const windowHeight = document.documentElement.clientHeight; const windowHeight = document.documentElement.clientHeight;
const viewportPosition = windowScrollPosition + windowHeight; const viewportPosition = windowScrollPosition + windowHeight;
const itemBottomPosition = element.offsetTop + element.offsetHeight; const itemBottomPosition = element.offsetTop + element.offsetHeight;