Skip to content

Commit

Permalink
fix(repeat): toc cannot be expanded automatically
Browse files Browse the repository at this point in the history
fix again:
729d89e
  • Loading branch information
liuyib committed Dec 10, 2020
1 parent 9f2df42 commit 3db6aea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ $(document).ready(function () {
return
}
if (currHeading !== lastHeading) {
var $targetLink = $('.sidebar-toc a[href="#' + currHeading + '"]')
var anchor = window.decodeURIComponent(currHeading)
var $targetLink = $('.sidebar-toc a[href="#' + anchor + '"]')
$allTocItem.removeClass('active current')
$targetLink.parents('li').addClass('active')
$targetLink.parent().addClass('current')
Expand Down

0 comments on commit 3db6aea

Please sign in to comment.