Commit ed5dbf1b authored by Chris Ziogas's avatar Chris Ziogas
Browse files

Update affix properly on scrollspy speedy scroll to top of page #11310

Fix scrollspy.js so as affix is updated properly when user scrolls fast
to top of page.

A fix for issue #11310.
parent aeee7182
Showing with 9 additions and 1 deletion
+9 -1
...@@ -1665,6 +1665,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" ...@@ -1665,6 +1665,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
return activeTarget != (i = targets.last()[0]) && this.activate(i) return activeTarget != (i = targets.last()[0]) && this.activate(i)
} }
if (activeTarget && scrollTop <= offsets[0]) {
return activeTarget != (i = targets.first()[0]) && this.activate(i)
}
for (i = offsets.length; i--;) { for (i = offsets.length; i--;) {
activeTarget != targets[i] activeTarget != targets[i]
&& scrollTop >= offsets[i] && scrollTop >= offsets[i]
......
This diff is collapsed.
...@@ -84,6 +84,10 @@ ...@@ -84,6 +84,10 @@
return activeTarget != (i = targets.last()[0]) && this.activate(i) return activeTarget != (i = targets.last()[0]) && this.activate(i)
} }
if (activeTarget && scrollTop <= offsets[0]) {
return activeTarget != (i = targets.first()[0]) && this.activate(i)
}
for (i = offsets.length; i--;) { for (i = offsets.length; i--;) {
activeTarget != targets[i] activeTarget != targets[i]
&& scrollTop >= offsets[i] && scrollTop >= offsets[i]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment