mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 10:34:07 +02:00
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.
This commit is contained in:
4
dist/js/bootstrap.js
vendored
4
dist/js/bootstrap.js
vendored
@@ -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]
|
||||||
|
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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]
|
||||||
|
Reference in New Issue
Block a user