aboutsummaryrefslogtreecommitdiff
path: root/src/View/Map/Marker.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/View/Map/Marker.ml')
-rw-r--r--src/View/Map/Marker.ml28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/View/Map/Marker.ml b/src/View/Map/Marker.ml
index 58ec4bd..e793742 100644
--- a/src/View/Map/Marker.ml
+++ b/src/View/Map/Marker.ml
@@ -20,12 +20,28 @@ let form on_validate init_name init_color init_icon =
[| |]
[| Form.input "g-MarkerForm__Name" "Name" init_name (fun newName -> name := newName)
; Form.color_input "g-MarkerForm__Color" "Color" init_color (fun newColor -> color := newColor)
- ; Autocomplete.create
- "g-MarkerForm__Icon"
- "Icon"
- FontAwesome.icons
- (fun newIcon -> let () = Js.log newIcon in icon := newIcon)
- [| HA.value init_icon |]
+ ; H.div
+ [| HA.class_ "g-Form__Field" |]
+ [| H.div
+ [| HA.class_ "g-Form__Label" |]
+ [| H.label
+ [| HA.for_ "g-MarkerForm__IconInput" |]
+ [| H.text "Icon" |]
+ |]
+ ; let dom_icon = H.div [| HA.class_ ("fa fa-" ^ !icon) |] [| |] in
+ Layout.line
+ [| |]
+ [| H.div [| HA.class_ "g-MarkerForm__Icon" |] [| dom_icon |]
+ ; Autocomplete.create
+ [| HA.value init_icon |]
+ "g-MarkerForm__IconInput"
+ FontAwesome.icons
+ (fun icon -> [| H.div [| HA.class_ ("fa fa-" ^ icon) |] [| |] ; H.text icon |])
+ (fun newIcon ->
+ let () = icon := newIcon in
+ Element.set_class_name dom_icon ("fa fa-" ^ newIcon))
+ |]
+ |]
|]
; Layout.line
[| |]