summaryrefslogtreecommitdiff
path: root/scripts/onload.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/onload.js')
-rw-r--r--scripts/onload.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/onload.js b/scripts/onload.js
index 5c63f35..165f80d 100644
--- a/scripts/onload.js
+++ b/scripts/onload.js
@@ -3,6 +3,13 @@ function addNodes() {
const container = document.getElementById("progressContainer");
for (var i = 0; i < collection.length; i++) {
- container.innerHTML += "<nodes class=\"sidebar-progress-node\"></nodes>\n";
+ var node = document.createElement("a");
+ node.className = "node";
+ container.appendChild(node);
+ if (collection.item(i).getAttribute('id') == null) {
+ collection.item(i).setAttribute('id', `section-${i}`);
+ }
+ node.setAttribute('id', `node-${i}`)
+ node.href = `#${collection.item(i).getAttribute('id')}`
}
-} \ No newline at end of file
+}