todo, scroll to cur pos
parent
f48d8dc533
commit
5fe85575dc
|
|
@ -1,4 +1,7 @@
|
||||||
todo:
|
todo:
|
||||||
|
- highlight current page
|
||||||
|
- search page tree is empty
|
||||||
|
- hide checkbox for tree
|
||||||
- delete button does nothing
|
- delete button does nothing
|
||||||
- do not rewrite .md title vs. link cause hrefs to ./gobs.md wont work
|
- do not rewrite .md title vs. link cause hrefs to ./gobs.md wont work
|
||||||
- https://codepen.io/bisserof/pen/nrMveb
|
- https://codepen.io/bisserof/pen/nrMveb
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,17 @@
|
||||||
}
|
}
|
||||||
function leafHTML(id, branch) {
|
function leafHTML(id, branch) {
|
||||||
const href="/ui/files/" + (id ? id : "#")
|
const href="/ui/files/" + (id ? id : "#")
|
||||||
const name=`filetree-leaf-${id}`
|
var nameSafeId = id.replace(/\//g, "-")
|
||||||
|
var parentNameSafeId = nameSafeId
|
||||||
|
if (id.includes("/"))
|
||||||
|
parentNameSafeId = id.slice(0, id.lastIndexOf("/")).replace(/\//g, "-")
|
||||||
|
const name=`filetree-leaf-${nameSafeId}`
|
||||||
|
const parentname=`filetree-leaf-${parentNameSafeId}`
|
||||||
const title=id ? branch.Leaf.Title : "ROOT"
|
const title=id ? branch.Leaf.Title : "ROOT"
|
||||||
return `
|
return `
|
||||||
<a style="flex-grow: 1;" href="${href}"><button style="width: 100%; text-align: left; outline: none;">${title}</button></a>
|
<div style="margin: 0; padding: 0; height: 0; width: 0;" id="${name}"></div>
|
||||||
<a href="${href}/${crypto.randomUUID().split("-")[0]}"><button>+</button></a>
|
<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>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
function branchesHTML(id, branches) {
|
function branchesHTML(id, branches) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue