From ed5dbf1b2b8187b6939ab10d75573118d346f970 Mon Sep 17 00:00:00 2001 From: Chris Ziogas Date: Mon, 4 Nov 2013 19:09:48 +0200 Subject: 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. --- js/scrollspy.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js') 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] -- cgit v1.2.3