From 16c677515615081253ff43be751eb86e0249a672 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 12 Nov 2017 14:48:49 +0000 Subject: [PATCH] Hide all of ToCs when absent --- static/src/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/src/js/index.js b/static/src/js/index.js index f5b03e8..c6ea6ef 100644 --- a/static/src/js/index.js +++ b/static/src/js/index.js @@ -32,7 +32,7 @@ $(document).ready(function () { $('#TableOfContents').each(function () { var ele = $(this); if (ele.find('a').length <= 3) { - ele.remove(); + ele.parent().remove(); } else if (ele.children('ul').children('li').length === 1) { ele.children('ul').replaceWith(ele.children('ul').children('li').children('ul')); }