Skip to content

Commit

Permalink
Javascript: Add support for deep toc levels (#1089)
Browse files Browse the repository at this point in the history
In ca015a5 support was added for tox levels up to 10.
This only fixed the css side, this commit makes a similar fix for the js side.

Fixes #893
  • Loading branch information
Blendify authored Mar 15, 2021
1 parent f8e71bf commit 68d4b8a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,10 @@ function ThemeNav () {
if (link.length > 0) {
$('.wy-menu-vertical .current').removeClass('current');
link.addClass('current');
link.closest('li.toctree-l1').addClass('current');
link.closest('li.toctree-l1').parent().addClass('current');
link.closest('li.toctree-l1').addClass('current');
link.closest('li.toctree-l2').addClass('current');
link.closest('li.toctree-l3').addClass('current');
link.closest('li.toctree-l4').addClass('current');
link.closest('li.toctree-l5').addClass('current');
for (let i = 1; i <= 10; i++) {
link.closest('li.toctree-l' + i).addClass('current');
}
link[0].scrollIntoView();
}
}
Expand Down

0 comments on commit 68d4b8a

Please sign in to comment.