()
| 31 | }); |
| 32 | |
| 33 | var updateFunction = function () { |
| 34 | var id = null; |
| 35 | var elements = document.getElementsByClassName("header"); |
| 36 | Array.prototype.forEach.call(elements, function (el) { |
| 37 | if (window.pageYOffset >= el.offsetTop) { |
| 38 | id = el; |
| 39 | } |
| 40 | }); |
| 41 | |
| 42 | Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el) { |
| 43 | el.classList.remove("active"); |
| 44 | }); |
| 45 | |
| 46 | Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el) { |
| 47 | if (id == null) { |
| 48 | return; |
| 49 | } |
| 50 | if (id.href.localeCompare(el.href) == 0) { |
| 51 | el.classList.add("active"); |
| 52 | } |
| 53 | }); |
| 54 | }; |
| 55 | |
| 56 | var pagetoc = document.getElementsByClassName("pagetoc")[0]; |
| 57 | var elements = document.getElementsByClassName("header"); |
nothing calls this directly
no outgoing calls
no test coverage detected