From 81b7f61c3b5d70a976574865014ba4eff3aaaffb Mon Sep 17 00:00:00 2001 From: scotty Date: Fri, 18 Nov 2016 12:56:07 -0800 Subject: [PATCH] disable TOC if there's only a link to the current page --- _layouts/docwithnav.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_layouts/docwithnav.html b/_layouts/docwithnav.html index c15077857a..f3d885d246 100755 --- a/_layouts/docwithnav.html +++ b/_layouts/docwithnav.html @@ -81,7 +81,7 @@ ga('create', 'UA-36037335-10', 'auto'); ga('send', 'pageview'); - // hide docs nav area if no nav is present + // hide docs nav area if no nav is present, or if nav only contains a link to the current page (function () { window.addEventListener('DOMContentLoaded', init) @@ -97,7 +97,8 @@ // container is built dynamically, so it may not be present on the first runloop if (container) { - if (container.childElementCount === 0) { + if (container.childElementCount === 0 || toc.querySelectorAll('a.item').length === 1) { + toc.style.display = 'none' document.getElementById('docsContent').style.width = '100%' } } else {