Skip to content

Commit

Permalink
Modify scrollspy to add .active to all parent li items /cc @fat
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Mar 30, 2013
1 parent 4dfc4e1 commit 23d7215
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/assets/js/bootstrap-scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@
this.activeTarget = target

$(this.selector)
.parent('.active')
.parents('.active')
.removeClass('active')

selector = this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'

active = $(selector)
.parent('li')
.parents('li')
.addClass('active')

if (active.parent('.dropdown-menu').length) {
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1621,15 +1621,15 @@
this.activeTarget = target

$(this.selector)
.parent('.active')
.parents('.active')
.removeClass('active')

selector = this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'

active = $(selector)
.parent('li')
.parents('li')
.addClass('active')

if (active.parent('.dropdown-menu').length) {
Expand Down
Loading

0 comments on commit 23d7215

Please sign in to comment.