if readonly, do not draw add-child button in tree
parent
a5fff37ba0
commit
d02c120e50
|
|
@ -53,11 +53,15 @@
|
||||||
const title=id ? branch.Leaf.Meta.Title : "ROOT"
|
const title=id ? branch.Leaf.Meta.Title : "ROOT"
|
||||||
const isLiveParent = '{{ .This.ID }}'.slice(0, id.length) == id
|
const isLiveParent = '{{ .This.ID }}'.slice(0, id.length) == id
|
||||||
const isLive = '{{ .This.ID }}' == id
|
const isLive = '{{ .This.ID }}' == id
|
||||||
return `
|
const linkToFile = `
|
||||||
<div style="margin: 0; padding: 0; height: 0; width: 0;" id="${name}"></div>
|
<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;" class="${isLiveParent ? `button button-info ${!isLive ? "button-border" : ""}` : ""}">${title}</button></a>
|
<a style="flex-grow: 1;" href="${href}#${parentname}">
|
||||||
<a href="${href}/${generateUUID().split("-")[0]}#${parentname}"><button>+</button></a>
|
<button style="width: 100%; text-align: left; outline: none;" class="${isLiveParent ? `button button-info ${!isLive ? "button-border" : ""}` : ""}">
|
||||||
|
${title}
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
`
|
`
|
||||||
|
return linkToFile + (branch.Leaf.Meta.ReadOnly ? "" : `<a href="${href}/${generateUUID().split("-")[0]}#${parentname}"><button>+</button></a>`)
|
||||||
}
|
}
|
||||||
function branchesHTML(id, branches) {
|
function branchesHTML(id, branches) {
|
||||||
if (!branchesHaveContent(branches))
|
if (!branchesHaveContent(branches))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue