Commit 825ee1c8 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[ERGO] SubTree sorted (sub projection of the main tree)

parent 9cf33e2f
...@@ -104,14 +104,13 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt ...@@ -104,14 +104,13 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
, dispatch , dispatch
, subTreeOut , subTreeOut
} _ = do } _ = do
pure $ H.div {} [ -- H.h5 { className: GT.fldr nodeType true} [] pure $ H.div {} [ H.div { className: "node " <> GT.fldr nodeType true}
H.div { className: "node " <> GT.fldr nodeType true} ( [ H.span { className: "name " <> clickable
( [ H.span { className: "name " <> clickable , on: { click: onClick }
, on: { click: onClick } } [ nodeText { isSelected: isSelected targetId subTreeOutParams
} [ nodeText { isSelected: isSelected targetId subTreeOutParams , name: " " <> name
, name }
} ]
]
] <> children ] <> children
) )
...@@ -119,14 +118,15 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt ...@@ -119,14 +118,15 @@ subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.subTreeTreeViewCpt" cpt
where where
SubTreeParams { valitypes } = subTreeParams SubTreeParams { valitypes } = subTreeParams
sortedAry = A.sortWith (\(NTree (LNode {id:id'}) _) -> id') ary
children = map (\c -> subTreeTreeView (p { tree = c })) ary children = map (\ctree -> subTreeTreeView (p { tree = ctree })) sortedAry
validNodeType = (A.elem nodeType valitypes) && (id /= targetId) validNodeType = (A.elem nodeType valitypes) && (id /= targetId)
clickable = if validNodeType then "clickable" else "" clickable = if validNodeType then "clickable" else ""
sbto@( subTreeOutParams /\ setSubTreeOut) = subTreeOut sbto@( subTreeOutParams /\ setSubTreeOut) = subTreeOut
isSelected n sbtop = case sbtop of isSelected n sbtop = case sbtop of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment