scroll-into-view
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "scroll-into-view", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "scrollIntoView.js", |
@@ -21,4 +21,4 @@ function setElementScroll(element, x, y){ | ||
y = targetPosition.top + window.scrollY - window.innerHeight / 2 + Math.min(targetPosition.height, window.innerHeight) / 2; | ||
x = Math.max(Math.min(x, document.body.clientWidth - window.innerWidth), 0); | ||
y = Math.max(Math.min(y, document.body.clientHeight - window.innerHeight), 0); | ||
x = Math.max(Math.min(x, document.body.clientWidth - window.innerWidth / 2), 0); | ||
y = Math.max(Math.min(y, document.body.clientHeight - window.innerHeight / 2), 0); | ||
differenceX = x - window.scrollX; | ||
@@ -75,3 +75,3 @@ differenceY = y - window.scrollY; | ||
var parent = target.parentNode, | ||
var parent = target.parentElement, | ||
targetPosition = target.getBoundingClientRect(), | ||
@@ -91,3 +91,3 @@ parentOverflow; | ||
parent = parent.parentNode; | ||
parent = parent.parentElement; | ||
} | ||
@@ -94,0 +94,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7217