Tooltip

com.alecdorrington.annotatedtextformat.dom.Tooltip
See theTooltip companion object
final class Tooltip

A tooltip in a page's top layer, where no part of the page can clip or cover it, holding any content in a shadow root, which the page's styles do not reach. It is kept within the window, and content too large for it scrolls within it. It opens on whichever side of the line it fits, keeping room there for it to grow to reserve tall, as when content to come will fill it. Once held, as the mouse that opened it holds it, if it is interactive, it keeps to that side as it grows, scrolling within the room there, rather than moving across the line from beneath the pointer crossing to it; and it covers the smallest convex shape holding both it and the line, though it shows nothing there, but the line itself, which takes the pointer as before, so that the pointer crossing to it, straight or slanting, is over it all the way, and never over what lies beneath, as a highlight on the line beyond or beside the word on its own, which would show a tooltip of its own. Each time it is shown is a Tooltip.Showing of its own, by which its content may be replaced while it lasts, as by an entry that arrives later, and it is placed again as its size changes.

Its host is the element in the page, an atf-tooltip, which no rule of the page for its own elements matches, with an id of its own, by which what it is for is described, and the role of a dialog if it is interactive, or else of a tooltip. It takes the attribute data-side, above or below, as it stands of the line it is for. It goes at the root of the page, or in the modal dialog open, outside which all is inert.

Its content inherits nothing from the page, so its styles must set its font, its colours and its background.

The pointer's presses, clicks and moves within it, and keys typed in it, if it is interactive, go no further than it, so that the page does not act on them, and a press leaves the focus where it was, but in a field, so that its text cannot be selected by the pointer. The page's own listeners on its window or its document that capture events still hear of them first, as nothing within the page can stop them.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def box: Option[Box]

The box that it covers, while it is open.

The box that it covers, while it is open.

Attributes

def focusables: List[HTMLElement]

What within it takes the focus, in order: its links, buttons and fields.

What within it takes the focus, in order: its links, buttons and fields.

Attributes

def focused: Option[Element]

What within it has the focus, if anything.

What within it has the focus, if anything.

Attributes

def hide(): Unit

Closes it, keeping it in the page to open again.

Closes it, keeping it in the page to open again.

Attributes

def id: String

The id of its host, by which what it is for is described.

The id of its host, by which what it is for is described.

Attributes

def isOpen: Boolean

Whether it is open.

Whether it is open.

Attributes

def remove(): Unit

Takes it out of the page.

Takes it out of the page.

Attributes

def show(content: Node, line: Box): Showing

Shows content for line, the box of the line of text it is for, as a showing of its own, by which it may be replaced until the tooltip closes or shows something else.

Shows content for line, the box of the line of text it is for, as a showing of its own, by which it may be replaced until the tooltip closes or shows something else.

Attributes

Concrete fields

val host: HTMLElement