Fix issue with toctree :titlesonly: and nav menu

This fixes #196 by filtering nav ul elements that have empty ul siblings
This commit is contained in:
Anthony Johnson 2015-07-17 00:18:02 -07:00
parent 6277c21110
commit 5392b7bdbd
3 changed files with 18 additions and 1 deletions

View File

@ -19,6 +19,11 @@ Contents:
demo demo
list list
.. toctree::
:titlesonly:
toc
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
:caption: This is an incredibly long caption for a long menu :caption: This is an incredibly long caption for a long menu

12
demo_docs/source/toc.rst Normal file
View File

@ -0,0 +1,12 @@
=========
TOC Tests
=========
One
===
Two
---
Three
`````

View File

@ -31,7 +31,7 @@ $(document).ready(function() {
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>"); $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
// Add expand links to all parents of nested ul // Add expand links to all parents of nested ul
$('.wy-menu-vertical ul').siblings('a').each(function () { $('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this); var link = $(this);
expand = $('<span class="toctree-expand"></span>'); expand = $('<span class="toctree-expand"></span>');
expand.on('click', function (ev) { expand.on('click', function (ev) {