Skip to content

Commit 2e25bd0

Browse files
committed
jump tree rendered
1 parent e634157 commit 2e25bd0

File tree

2 files changed

+170
-16
lines changed

2 files changed

+170
-16
lines changed

calcit.cirru

Lines changed: 143 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,28 @@
2121
respo-alerts.core :refer $ use-modal
2222
:defs $ {}
2323
|comp-nav-tree $ quote
24-
defcomp comp-nav-tree (docs on-select)
25-
div ({}) (<> "\"TODO")
24+
defcomp comp-nav-tree (docs base-path on-select)
25+
list-> ({})
26+
-> docs $ map
27+
fn (entry)
28+
[] (:key entry)
29+
div ({})
30+
div
31+
{} (:class-name "\"doc-entry")
32+
:style $ {} (:padding "\"0 8px") (:cursor :pointer)
33+
:on-click $ fn (e d!)
34+
on-select
35+
conj base-path $ :key entry
36+
, d!
37+
<> $ :title entry
38+
if-let
39+
xs $ :children entry
40+
div
41+
{} $ :style
42+
{} $ :padding-left 16
43+
comp-nav-tree xs
44+
conj base-path $ :key entry
45+
, on-select
2646
|style-entry $ quote
2747
def style-entry $ {} (:padding "\"0 8px") (:cursor :pointer) (:transition-duration "\"200ms") (:line-height 2.4)
2848
:border-bottom $ str "\"1px solid " (hsl 0 0 92)
@@ -42,13 +62,14 @@
4262
history $ :history state
4363
quick-modal $ use-modal (>> states :quick)
4464
{} (:title "|Quick jump")
45-
:style $ {} (:max-width "\"60vw") (:height "\"80vh")
65+
:style $ {} (:max-width "\"40vw") (:height "\"90vh") (:max-height "\"90vh") (:margin-right 0)
4666
:render $ fn (on-close)
4767
div
4868
{} $ :style
4969
{} $ :padding "\"0 16px"
50-
comp-nav-tree docs $ fn (path d!)
51-
d! cursor $ next-path state path
70+
comp-nav-tree docs ([])
71+
fn (path d!)
72+
d! cursor $ next-path state path
5273
div
5374
{} (:class-name "\"calcit-tile")
5475
:style $ merge ui/fullscreen ui/global ui/row
@@ -59,7 +80,7 @@
5980
div
6081
{} $ :on-click
6182
fn (e d!) (.show quick-modal d!)
62-
<> "\"Quick Search"
83+
<> "\"Quick Search" $ {} (:cursor :pointer)
6384
div
6485
{} $ :style
6586
{} $ :margin-top 12

0 commit comments

Comments
 (0)