diff --git a/js/docs.js b/js/docs.js index 3ee6e31cfa..90cb712a7f 100644 --- a/js/docs.js +++ b/js/docs.js @@ -29,30 +29,30 @@ function navClicked(sourceLink) { var outputLetNav = []; var totalTopics = 0; -function findMyTopic(tree) { +function pageIsInSection(tree) { function processBranch(branch) { - for (var k = 0; k < branch.length; k++) { + for (let k = 0; k < branch.length; k++) { if (branch[k].section) { processBranch(branch[k].section); } else { if (branch[k].path === pageURL && !branch[k].nosync) { - thisIsIt = true; + found = true; break; } } } } - var thisIsIt = false; + let found = false; processBranch(tree); - return thisIsIt; + return found; } function walkTree(tree) { - for (var j = 0; j < tree.length; j++) { + for (let j = 0; j < tree.length; j++) { totalTopics++; if (tree[j].section) { - var sectionHasPath = findMyTopic(tree[j].section); + let sectionHasPath = pageIsInSection(tree[j].section); outputLetNav.push('