diff --git a/javascript/DocumentationViewer.js b/javascript/DocumentationViewer.js index ce37eb8..6d203c6 100755 --- a/javascript/DocumentationViewer.js +++ b/javascript/DocumentationViewer.js @@ -12,17 +12,21 @@ // Remove existing anchor redirection in the url var pageURL = window.location.href.replace(/#[a-zA-Z0-9\-\_]*/g, ''); - + + var itemCount = 0; $('#content-column h1[id], #content-column h2[id], #content-column h3[id], #content-column h4[id]').each(function(i) { var current = $(this); var tagName = current.prop("tagName"); if(typeof tagName == "String") tagName = tagName.toLowerCase(); - + itemCount++; toc += '
  • ' + current.html() + '
  • '; }); - + + // if no items in the table of contents, don't show anything + if(itemCount == 0) return false; + toc += ''; - + // Table of content location var title = $('#content-column h1:first'); if (title.length > 0) {