blob: 7a598e588912411c25d5aa7de63587580c35b8e7 (
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
26
|
let mainElt = Document.querySelectorUnsafe "#g-Layout__Main"
let isRunning = ref false
let start ~onHidden ~onEnded =
if not !isRunning then
let () = isRunning := true in
let () = Element.setClassName mainElt "g-Layout__HideMain" in
let delay = 200 in
let _ =
Js.Global.setTimeout
(fun () ->
let () = onHidden () in
let () = Element.setClassName mainElt "" in
let _ =
Js.Global.setTimeout
(fun () ->
let () = onEnded () in
isRunning := false)
delay
in
())
delay
in
()
else ()
|