Skip to content

Commit 9d704f2

Browse files
petermdBlendify
authored andcommitted
Follow-up grunt for #472 (#476)
* grunt run * regenerate theme css
1 parent ee4d440 commit 9d704f2

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

sphinx_rtd_theme/static/css/theme.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sphinx_rtd_theme/static/css/theme.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sphinx_rtd_theme/static/js/theme.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ function ThemeNav () {
109109
// Try again with the closest section entry.
110110
link = $('.wy-menu-vertical')
111111
.find('[href="#' + closest_section.attr("id") + '"]');
112-
113112
}
114-
$('.wy-menu-vertical li.toctree-l1 li.current')
115-
.removeClass('current');
116-
link.closest('li.toctree-l2').addClass('current');
117-
link.closest('li.toctree-l3').addClass('current');
118-
link.closest('li.toctree-l4').addClass('current');
113+
// If we found a matching link then reset current and re-apply
114+
// otherwise retain the existing match
115+
if (link.length > 0) {
116+
$('.wy-menu-vertical li.toctree-l1 li.current').removeClass('current');
117+
link.closest('li.toctree-l2').addClass('current');
118+
link.closest('li.toctree-l3').addClass('current');
119+
link.closest('li.toctree-l4').addClass('current');
120+
}
119121
}
120122
catch (err) {
121123
console.log("Error expanding nav for anchor", err);

0 commit comments

Comments
 (0)