]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update js/bootstrap-scrollspy.js 6118/head
authorGodric <godric@0x3f.fr>
Tue, 4 Dec 2012 00:21:07 +0000 (01:21 +0100)
committerGodric <godric@0x3f.fr>
Tue, 4 Dec 2012 00:21:07 +0000 (01:21 +0100)
Fix for Bootstrap issue #6013 "scrollSpy - offset calculation"
https://github.com/twitter/bootstrap/issues/6013

js/bootstrap-scrollspy.js

index 3ffda2ebe71be02bb572d3ebba71e194fda2d70a..ace6b87034b988bb5ee049152d1db3f6c2ebd2fd 100644 (file)
@@ -59,7 +59,7 @@
               , $href = /^#\w/.test(href) && $(href)
             return ( $href
               && $href.length
-              && [[ $href.position().top, href ]] ) || null
+              && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
           })
           .sort(function (a, b) { return a[0] - b[0] })
           .each(function () {