Module Tooltip.Tooltip_viewSource

Describes the way a tooltip is displayed.

Sourcetype t

TooltypeView

include Jv.CONV with type t := t
val to_jv : t -> Jv.jv

to_jv reveals the JavaScript implementation.

val of_jv : Jv.jv -> t

of_jv hides the JavaScript implementation. Implementations usually do not guarantee type safety.

Sourceval dom : t -> Brr.El.t

The DOM element to position over the editor.

Sourcetype offset = {
  1. x : int;
  2. y : int;
}
Sourcetype coords = {
  1. left : int;
  2. right : int;
  3. top : int;
  4. bottom : int;
}
Sourceval offset : t -> offset
Sourceval create : dom:Brr.El.t -> ?offset:offset -> ?get_coords:(int -> coords) -> ?overlap:bool -> ?mount:(Code_mirror.View.EditorView.t -> unit) -> ?update:(Code_mirror.View.EditorView.Update.t -> unit) -> ?positioned:(unit -> unit) -> unit -> t

Creates a TooltipView:

  • parameter dom

    The DOM element to position over the editor.

  • parameter offset

    Adjust the position of the tooltip relative to its anchor position.

  • parameter get_coords

    This method can be provided to make the tooltip view itself responsible for finding its screen position.

  • parameter overlap

    By default, tooltips are moved when they overlap with other tooltips. Set this to true to disable that behavior for this tooltip.

  • parameter mount

    Called after the tooltip is added to the DOM for the first time.

  • parameter update

    Update the DOM element for a change in the view's state.

  • parameter positioned

    Called when the tooltip has been (re)positioned.

See the reference for additional information.