asr-scroll-position
Advanced tools
Comparing version 1.0.1 to 1.1.0
18
index.js
@@ -34,11 +34,13 @@ const historyState = require(`better-history-api`) | ||
afterSuccessfulStateChange(stateRouter, () => { | ||
const anchorElement = getElementById(currentAnchor()) | ||
window.requestAnimationFrame(() => { | ||
const anchorElement = getElementById(currentAnchor()) | ||
if (anchorElement) { | ||
scrollToElement(anchorElement) | ||
} else if (atTop()) { | ||
updatePosition() | ||
} else { | ||
scrollToTop() | ||
} | ||
if (anchorElement) { | ||
scrollToElement(anchorElement) | ||
} else if (atTop()) { | ||
updatePosition() | ||
} else { | ||
scrollToTop() | ||
} | ||
}) | ||
}) | ||
@@ -45,0 +47,0 @@ }) |
{ | ||
"name": "asr-scroll-position", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Manually update the browser's scroll position when using pushState routing with abstract-state-router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
4849
104