MCPcopy Create free account
hub / github.com/Code-dot-mil/code.mil / insertSubNav

Function insertSubNav

assets/js/main.js:57–75  ·  view source on GitHub ↗
(jumpNodeSelector, basePath, skipCount)

Source from the content-addressed store, hash-verified

55 }
56
57 function insertSubNav(jumpNodeSelector, basePath, skipCount) {
58 var list = document.querySelector('.usa-sidenav-sub_list');
59 jumpNodeSelector = jumpNodeSelector || 'h1';
60 basePath = basePath || '/';
61 skipCount = skipCount || 0;
62
63 if (list) {
64 find(jumpNodeSelector)
65 .forEach(function(node, i) {
66 if (i < skipCount) {
67 return;
68 }
69
70 var item = document.createElement('li');
71 item.innerHTML = '<a href="' + basePath + '#' + node.getAttribute('id') + '">' + node.innerText + '</a>';
72 list.appendChild(item);
73 });
74 }
75 }
76 })();
77
78 (function DecisionTree() {

Callers 1

main.jsFile · 0.85

Calls 1

findFunction · 0.85

Tested by

no test coverage detected