Hide small ToCs
This commit is contained in:
parent
92f24f8644
commit
fb64abbe06
1 changed files with 5 additions and 3 deletions
|
@ -29,10 +29,12 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
// HACK: ToC has blank li if no initial header
|
||||
$('#TableOfContents > ul > li').each(function () {
|
||||
$('#TableOfContents').each(function () {
|
||||
var ele = $(this);
|
||||
if (ele.children('a').length === 0) {
|
||||
ele.parent().replaceWith(ele.find('ul').eq(0));
|
||||
if (ele.find('a').length <= 3) {
|
||||
ele.remove();
|
||||
} else if (ele.children('ul').children('li').length === 1) {
|
||||
ele.children('ul').replaceWith(ele.children('ul').children('li').children('ul'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue