Commit e224f744 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] buttonClick when not closed

parent 787a9d22
...@@ -59,12 +59,17 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -59,12 +59,17 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
where where
cpt p _ = do cpt p _ = do
isOpen <- R.useState' false isOpen <- R.useState' false
nodePopupState@(nodePopup /\ setNodePopup) <- R.useState' { action : Nothing
, id : p.id nodePopupState@(nodePopup /\ setNodePopup)
, name : p.name <- R.useState' { action : Nothing
, nodeType: p.nodeType , id : p.id
} , name : p.name
search <- R.useState' $ defaultSearch { node_id = Just p.id } , nodeType: p.nodeType
}
search <- R.useState'
$ defaultSearch { node_id = Just p.id }
pure $ H.div tooltipProps $ pure $ H.div tooltipProps $
[ H.div { className: "popup-container" } [ H.div { className: "popup-container" }
[ H.div { className: "panel panel-default" } [ H.div { className: "panel panel-default" }
...@@ -199,9 +204,7 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt ...@@ -199,9 +204,7 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
(action == (Just todo) ) (action == (Just todo) )
, id: show todo , id: show todo
, title: show todo , title: show todo
, onClick : mkEffectFn1 , onClick : mkEffectFn1 $ \_ -> undo *> doToDo
$ \_ -> setNodePopup
$ const (node { action = action' })
} }
[] []
] ]
...@@ -210,6 +213,13 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt ...@@ -210,6 +213,13 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
then Nothing then Nothing
else (Just todo) else (Just todo)
undo = setNodePopup
$ const (node { action = Nothing })
doToDo = setNodePopup
$ const (node { action = action' })
-- END Popup View -- END Popup View
type NodeProps = type NodeProps =
( id :: ID ( id :: ID
......
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