aboutsummaryrefslogtreecommitdiff
path: root/src/Lib/Modal.ml
diff options
context:
space:
mode:
authorJoris2020-08-08 12:49:03 +0200
committerJoris2020-08-08 12:49:03 +0200
commit081e6aae57719c15bdbc5e973ca7ddba9506a4bb (patch)
treea8de15bb4165639cf283bde7b7e63eb330e83d88 /src/Lib/Modal.ml
parent4ee0dfae75fda3a8b6347d55c728b50ce5c210d9 (diff)
downloadmap-081e6aae57719c15bdbc5e973ca7ddba9506a4bb.tar.gz
map-081e6aae57719c15bdbc5e973ca7ddba9506a4bb.tar.bz2
map-081e6aae57719c15bdbc5e973ca7ddba9506a4bb.zip
Show context menu to add, modify and delete markers
Diffstat (limited to 'src/Lib/Modal.ml')
-rw-r--r--src/Lib/Modal.ml25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Lib/Modal.ml b/src/Lib/Modal.ml
new file mode 100644
index 0000000..3fa0550
--- /dev/null
+++ b/src/Lib/Modal.ml
@@ -0,0 +1,25 @@
+let hide () =
+ let modal = Document.query_selector_unsafe "#g-Modal" in
+ Element.remove_child Document.body modal
+
+let show content =
+ let view =
+ H.div
+ [| HA.id "g-Modal" |]
+ [| H.div
+ [| HA.class_ "g-Modal__Curtain"
+ ; HE.on_click (fun _ -> hide ())
+ |]
+ [| |]
+ ; H.div
+ [| HA.class_ "g-Modal__Window" |]
+ [| H.button
+ [| HA.class_ "g-Modal__Close"
+ ; HE.on_click (fun _ -> hide ())
+ |]
+ [| H.div [| HA.class_ "fa fa-close" |] [| |] |]
+ ; content
+ |]
+ |]
+ in
+ Element.append_child Document.body view