Implement client actions properly
This commit is contained in:
parent
5902421872
commit
70e3386cb5
2 changed files with 41 additions and 12 deletions
|
|
@ -5,6 +5,7 @@ module Forest.Client.Tree
|
|||
, renderTree
|
||||
-- * Focused element
|
||||
, getCurrent
|
||||
, getCurrentPath
|
||||
, moveUp
|
||||
, moveDown
|
||||
-- * Folding
|
||||
|
|
@ -85,6 +86,10 @@ getCurrent :: Tree -> Node
|
|||
-- We rely on the invariant that the focused node always exists
|
||||
getCurrent tree = fromJust $ applyPath (treeFocused tree) (treeNode tree)
|
||||
|
||||
-- | Get the path of the currently focused node.
|
||||
getCurrentPath :: Tree -> Path
|
||||
getCurrentPath = treeFocused
|
||||
|
||||
flatten :: Node -> [Path]
|
||||
flatten node =
|
||||
let flattenedChildren =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue