aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorChris Ziogas <[email protected]>2013-11-04 19:09:48 +0200
committerChris Ziogas <[email protected]>2013-11-07 16:39:57 +0200
commited5dbf1b2b8187b6939ab10d75573118d346f970 (patch)
treec0dc32017ab67274705ea6aacfc1e263e417edf7 /js
parentaeee718247711d70b766ef9fac5bf0723c7cf905 (diff)
downloadbootstrap-ed5dbf1b2b8187b6939ab10d75573118d346f970.tar.xz
bootstrap-ed5dbf1b2b8187b6939ab10d75573118d346f970.zip
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.
Diffstat (limited to 'js')
-rw-r--r--js/scrollspy.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/scrollspy.js b/js/scrollspy.js
index 19ed6fcd5..cc52e153a 100644
--- a/js/scrollspy.js
+++ b/js/scrollspy.js
@@ -84,6 +84,10 @@
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--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]