From 5fe85575dc564eb79f6685d3ac5ac80355d57f6c Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Tue, 15 Feb 2022 16:40:09 -0700 Subject: [PATCH] todo, scroll to cur pos --- spike/review/reinvent/ezmded/server/todo.yaml | 3 +++ .../reinvent/ezmded/ui/templates/_filetree.ctmpl | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/spike/review/reinvent/ezmded/server/todo.yaml b/spike/review/reinvent/ezmded/server/todo.yaml index 819a906..4180549 100644 --- a/spike/review/reinvent/ezmded/server/todo.yaml +++ b/spike/review/reinvent/ezmded/server/todo.yaml @@ -1,4 +1,7 @@ todo: +- highlight current page +- search page tree is empty +- hide checkbox for tree - delete button does nothing - do not rewrite .md title vs. link cause hrefs to ./gobs.md wont work - https://codepen.io/bisserof/pen/nrMveb diff --git a/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl b/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl index ce1a85e..54aa3ef 100644 --- a/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl +++ b/spike/review/reinvent/ezmded/ui/templates/_filetree.ctmpl @@ -35,11 +35,17 @@ } function leafHTML(id, branch) { 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" return ` - - +
+ + ` } function branchesHTML(id, branches) {