Commit 428bb451 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge branch 'issue181' into dev

parents 7d49a203 4fc20136
......@@ -18,47 +18,9 @@
<link href="styles/CodeEditor.css" rel="stylesheet" type="text/css" />
<link href="styles/range-slider.css" rel="stylesheet" type="text/css" />
<style>
* {margin: 0; padding: 0; list-style: none;}
.tree ul li {
margin-left: 15px;
position: relative;
padding-left: 5px;
}
#toolbar {display : inline;}
#toolbar ul li {display : inline }
#toolbar ul li form {display : inline}
.tree { margin-top : 20px;}
.tree ul li::before {
content: " ";
position: absolute;
width: 1px;
background-color: #000;
top: 5px;
bottom: -12px;
left: -10px;
}
body > .tree ul > li:first-child::before {top: 12px;}
.tree ul li:not(:first-child):last-child::before {display: none;}
.tree ul li:only-child::before {
display: list-item;
content: " ";
position: absolute;
width: 1px;
background-color: "#000";
top: 5px;
bottom: 7px;
height: 7px;
left: -10px;
}
.tree ul li::after {
content: " ";
position: absolute;
left: -10px;
width: 10px;
height: 1px;
background-color: "#000";
top: 12px;
}
.tree { margin: 0; padding: 0; border: 0; }
.tree LI { list-style: none; }
.tree UL { margin: 0 0 0 1.5em; border: 0; padding: 0; }
</style>
</head>
<body>
......
......@@ -123,7 +123,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, tasks
, tree
, session
} _ = pure $ H.div { className: "tree"}
} _ = pure $ H.ul { className: "tree"}
[ toHtml { asyncTasks
, frontends
, mCurrentRoute
......@@ -176,9 +176,8 @@ toHtml p@{ asyncTasks
let withId (NTree (LNode {id: id'}) _) = id'
pure $ H.ul {}
[ H.li {}
( [ nodeMainSpan { id
pure $ H.li {} $
[ nodeMainSpan { id
, dispatch: pAction
, folderOpen
, frontends
......@@ -188,15 +187,12 @@ toHtml p@{ asyncTasks
, session
, tasks
} ]
<> childNodes (Record.merge commonProps
<> childNodes ( Record.merge commonProps
{ asyncTasks
, children: ary
, folderOpen
}
)
)
]
type ChildNodesProps =
( asyncTasks :: R.State GAT.Storage
......@@ -209,12 +205,12 @@ childNodes :: Record ChildNodesProps -> Array R.Element
childNodes { children: [] } = []
childNodes { folderOpen: (false /\ _) } = []
childNodes props@{ asyncTasks, children, reload } =
map (\ctree@(NTree (LNode {id}) _) ->
map (\ctree@(NTree (LNode {id}) _) -> H.ul {} [
toHtml (Record.merge commonProps { asyncTasks
, tasks: tasksStruct id asyncTasks reload
, tree: ctree
}
)
)]
) $ sorted children
where
commonProps = RecordE.pick props :: Record CommonProps
......
......@@ -57,7 +57,8 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
popoverRef <- R.useRef null
pure $ H.span (dropProps droppedFile isDragOver) $
[ folderIcon nodeType folderOpen
[ chevronIcon nodeType folderOpen
, folderIcon nodeType folderOpen
, if showBox then
Popover.popover { arrow: false
, open: false
......@@ -94,6 +95,15 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
name' {name, nodeType} = if nodeType == GT.NodeUser
then show session
else name
chevronIcon nodeType folderOpen'@(open /\ _) =
H.a { className: "chevron-icon"
, onClick: R2.effToggler folderOpen'
}
[ H.i {
className: if open
then "fa fa-chevron-down"
else "fa fa-chevron-right"
} [] ]
folderIcon nodeType folderOpen'@(open /\ _) =
H.a { className: "folder-icon"
......
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