Skip to content

Commit 0f876fd

Browse files
authored
Merge branch 'master' into master
2 parents 89cfd99 + 9d704f2 commit 0f876fd

File tree

6 files changed

+29
-15
lines changed

6 files changed

+29
-15
lines changed

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
.. _demo: http://docs.readthedocs.org
1010
.. _hidden: http://sphinx-doc.org/markup/toctree.html
1111

12+
.. image:: https://img.shields.io/pypi/v/sphinx_rtd_theme.svg
13+
:target: https://pypi.python.org/pypi/sphinx_rtd_theme
14+
.. image:: https://travis-ci.org/rtfd/sphinx_rtd_theme.svg?branch=master
15+
:target: https://travis-ci.org/rtfd/sphinx_rtd_theme
16+
.. image:: https://img.shields.io/pypi/l/sphinx_rtd_theme.svg
17+
:target: https://pypi.python.org/pypi/sphinx_rtd_theme/
18+
:alt: license
19+
1220
**************************
1321
Read the Docs Sphinx Theme
1422
**************************

js/theme.js

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

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
]
3636
},
3737
classifiers=[
38+
'Framework :: Sphinx',
39+
'Framework :: Sphinx :: Theme',
3840
'Development Status :: 5 - Production/Stable',
3941
'License :: OSI Approved :: MIT License',
4042
'Environment :: Console',

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)