Commit 56c7def5 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

tree: create node panel with close button

Also, absolute positioning applied to make it look nicer.
parent 04f9649b
...@@ -90,6 +90,17 @@ li#rename #rename-a{ ...@@ -90,6 +90,17 @@ li#rename #rename-a{
z-index: 1000; z-index: 1000;
} }
#create-node-tooltip {
position : absolute;
left : 96px;
top:-64px;
background-color: white;
z-index: 1000;
}
#create-node-tooltip .panel-body input {
min-width: 200px;
}
li a#rename { li a#rename {
display:none; display:none;
......
...@@ -296,7 +296,7 @@ renameTreeView :: (Action -> Effect Unit) -> FTree -> ID -> ReactElement ...@@ -296,7 +296,7 @@ renameTreeView :: (Action -> Effect Unit) -> FTree -> ID -> ReactElement
renameTreeView d s@(NTree (LNode {id, name, nodeType, open, popOver, renameNodeValue, showRenameBox }) ary) nid = renameTreeView d s@(NTree (LNode {id, name, nodeType, open, popOver, renameNodeValue, showRenameBox }) ary) nid =
div [ className "" div [ className ""
, _id "rename-tooltip" , _id "rename-tooltip"
, _data {toggle : "tooltip", placement : "right"} , _data {toggle: "tooltip", placement: "right"}
, title "Settings on right"] $ , title "Settings on right"] $
[ div [_id "arrow"] [] [ div [_id "arrow"] []
, div [ className "panel panel-default" , div [ className "panel panel-default"
...@@ -385,31 +385,41 @@ renameTreeView d s@(NTree (LNode {id, name, nodeType, open, popOver, renameNodeV ...@@ -385,31 +385,41 @@ renameTreeView d s@(NTree (LNode {id, name, nodeType, open, popOver, renameNodeV
createNodeView :: (Action -> Effect Unit) -> FTree -> ID -> ReactElement createNodeView :: (Action -> Effect Unit) -> FTree -> ID -> ReactElement
createNodeView d s@(NTree (LNode {id, name, nodeType, open, popOver, nodeValue }) ary) nid = createNodeView d s@(NTree (LNode {id, name, nodeType, open, popOver, nodeValue }) ary) nid =
div [className ""] div [ className ""
[ div [className "panel panel-default"] , _id "create-node-tooltip"
[ , _data {toggle: "tooltip", placement: "right"}
div [className "panel-heading"] , title "Create new node"] $
[ [ div [className "panel panel-default"]
h5 [] [text "Create Node"] [
] div [className "panel-heading"]
,div [className "panel-body"] [
[ div [className "row"]
input [ _type "text" [ div [ className "col-md-10"]
, placeholder "Create Node" [ h5 [] [text "Create Node"] ]
, defaultValue $ getCreateNodeValue s , div [className "col-md-2"]
, className "col-md-12 form-control" [ a [className "btn text-danger glyphitem glyphicon glyphicon-remove"
, onInput \e -> d (SetNodeValue (unsafeEventValue e) nid) , onClick $ \_ -> d $ ToggleCreateNode nid
] , title "Close"] []
]
, div [className "panel-footer"]
[ button [className "btn btn-success"
, _type "button"
, onClick \_ -> d $ (CreateSubmit nid nodeValue)
] [text "Create"]
]
] ]
] ]
]
,div [className "panel-body"]
[
input [ _type "text"
, placeholder "Create Node"
, defaultValue $ getCreateNodeValue s
, className "col-md-12 form-control"
, onInput \e -> d (SetNodeValue (unsafeEventValue e) nid)
]
]
, div [className "panel-footer"]
[ button [className "btn btn-success"
, _type "button"
, onClick \_ -> d $ (CreateSubmit nid nodeValue)
] [text "Create"]
]
]
]
renameTreeViewDummy :: (Action -> Effect Unit) -> FTree -> ReactElement renameTreeViewDummy :: (Action -> Effect Unit) -> FTree -> ReactElement
......
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