]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update scrollspy.js
authormoodyroto <michael.rotoloni@moodys.com>
Mon, 11 Nov 2013 17:21:34 +0000 (12:21 -0500)
committermoodyroto <michael.rotoloni@moodys.com>
Mon, 11 Nov 2013 17:21:34 +0000 (12:21 -0500)
Scrollspy target in tab content does not work properly. Calling .parents('.active') will return all parents with an active class (including the tab pane). Changing this line to .parentsUntil(this.options.target, '.active') should resolve the issue. This will scope the query to only search for active elements inside the scrollspy target.

js/scrollspy.js

index 1d2fc7859577087fc48e08894ebb7683cfe657bb..295c2e0758925b22ae7a683c9b8b7d639c5a7b59 100644 (file)
@@ -96,7 +96,7 @@
     this.activeTarget = target
 
     $(this.selector)
-      .parents('.active')
+      .parentsUntil(this.options.target, '.active')
       .removeClass('active')
 
     var selector = this.selector