File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,16 @@ let%client display ?(container_a = [a_class ["ot-tip-container"]])
4242 @@ (div ~a: [a_class [" ot-tip-src" ]] [] :: content (fun () -> ! close () ))
4343 in
4444 let container_elt = To_dom. of_element container in
45- let d_height = float Dom_html. document##.documentElement##.clientHeight in
46- let d_width = float Dom_html. document##.documentElement##.clientWidth in
45+ let d_height =
46+ float
47+ @@ Js.Optdef. get Dom_html. window##.innerHeight
48+ @@ fun () -> Dom_html. document##.documentElement##.clientHeight
49+ in
50+ let d_width =
51+ float
52+ @@ Js.Optdef. get Dom_html. window##.innerWidth
53+ @@ fun () -> Dom_html. document##.documentElement##.clientWidth
54+ in
4755 let o_bounds = origin##getBoundingClientRect in
4856 let o_left = o_bounds##.left in
4957 let o_right = o_bounds##.right in
You can’t perform that action at this time.
0 commit comments