blob: 3fa0550116544b687defca5ffced203c76ae3ea0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
|