This commit is contained in:
Bel LaPointe
2022-02-16 07:58:34 -07:00
parent 552a3f46ff
commit 63caf9ed03
8 changed files with 199 additions and 211 deletions

View File

@@ -46,7 +46,7 @@
return `
<div style="margin: 0; padding: 0; height: 0; width: 0;" id="${name}"></div>
<a style="flex-grow: 1;" href="${href}#${parentname}"><button style="width: 100%; text-align: left; outline: none;">${title}</button></a>
<a href="${href}/${crypto.randomUUID().split("-")[0]}#${parentname}"><button>+</button></a>
<a href="${href}/${generateUUID().split("-")[0]}#${parentname}"><button>+</button></a>
`
}
function branchesHTML(id, branches) {
@@ -55,7 +55,7 @@
var out = ``
for(var i in branches) {
out += `<details open>`
out += branchHTML((id ? id + "/" : "") + i, branches[i])
out += branchHTML(i, branches[i])
out += `</details>`
}
return out
@@ -66,6 +66,6 @@
n += 1
return n > 0
}
drawTree(JSON.parse(`{{ .Tree }}`))
drawTree(JSON.parse({{ .Tree }}))
</script>
{{ end }}