Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 1.04 KB | None | 0 0
  1.   let initialize_tooltips () =
  2.     (ignore [%client ((
  3.         Lwt.async (fun () ->
  4.             (* We must initialize all the filter tooltips manually once the contents have loaded. *)
  5.             let jQuery = Js.Unsafe.js_expr "jQuery" in
  6.             let tooltips = [|Js.Unsafe.inject @@ Js.string ("[data-toggle=\"tooltip\"]")|] in
  7.  
  8.             let tooltip_initialization_function = "tooltip" in
  9.             ignore @@ Js.Unsafe.fun_call jQuery tooltips
  10.             |> (fun o -> Js.Unsafe.meth_call o tooltip_initialization_function [||])
  11.           )
  12.       ) : unit)])
  13.  
  14. let filters_form ((r, f) : react_pointer) =
  15.     let open Eliom_shared in
  16.     let open Html.D in
  17.     let dropdowns = create_dropdowns (r, f) in
  18.     let toggles = create_toggles (r, f) in
  19.     ignore [%client ((
  20.         Lwt.async (fun () ->
  21.             (* We must initialize all the filter tooltips manually once the contents have loaded. *)
  22.             Js_of_ocaml_lwt.Lwt_js_events.domContentLoaded () >>= (Lwt.return % initialize_tooltips)
  23.           );
  24.       ) : unit)];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement