Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
239057d5
Commit
239057d5
authored
Mar 13, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TREE] some options to add in the tree (css).
parent
ac100325
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
DocView.purs
src/DocView.purs
+21
-8
No files found.
src/DocView.purs
View file @
239057d5
...
@@ -197,23 +197,36 @@ exampleTree =
...
@@ -197,23 +197,36 @@ exampleTree =
------------------------------------------------------------------------
------------------------------------------------------------------------
-- TODO
-- alignment to the right
nodeOptionsCorp = [ i [className "fab fa-whmcs" ] []]
-- TODO
-- alignment to the right
-- on hover make other options available:
nodeOptionsView = [ i [className "fas fa-sync-alt" ] []
, i [className "fas fa-upload" ] []
, i [className "fas fa-share-alt"] []
]
toHtml :: _ -> FTree -> ReactElement
toHtml :: _ -> FTree -> ReactElement
toHtml d (NLeaf (Tuple name link)) =
toHtml d (NLeaf (Tuple name link)) =
li []
li []
[ a [ href link]
[ a [ href link]
[ text name
( [ text (name <> " ")
]
] <> nodeOptionsView
)
]
]
toHtml d (NNode id open name ary) =
toHtml d (NNode id open name ary) =
ul [ ]
ul [ ]
[ li [] $
[ li [] $
[ a [onClick $ (\e-> d $ ToggleFolder id)] [i [fldr open] []]
(
[ a [onClick $ (\e-> d $ ToggleFolder id)] [i [fldr open] []]
, text $ " " <> name
, text $ " " <> name <> " "
]
<>
] <> nodeOptionsCorp
<>
if open then
if open then
map (toHtml d) ary
map (toHtml d) ary
else []
else []
)
]
]
fldr :: Boolean -> Props
fldr :: Boolean -> Props
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment