Options
All
  • Public
  • Public/Protected
  • All
Menu

The "caret mark" is the graphical indicator showing the position of the caret.

Hierarchy

  • CaretMark

Index

Constructors

constructor

  • Parameters

    • manager: CaretManager

      The caret manager that holds this marker.

    • doc: Document

      The document in which the caret is located.

    • layer: Layer

      The layer that holds the caret.

    • inputField: HTMLElement

      The input field element that ought to be moved with the caret.

    • scroller: Scroller

      The scroller element that contains the editor document for which we are managing a caret.

    Returns CaretMark

Properties

boundRefresh

boundRefresh: function

The refresh method, already bound to this object.

Type declaration

    • (): void
    • Returns void

Private dummy

dummy: HTMLElement

This is an element used to calculate the position of the caret on the screen. It is temporarily inserted in the DOM to perform the position calculations.

Private el

el: HTMLElement

This is the element that represents the caret in the DOM tree.

Private inputField

inputField: HTMLElement

The input field element that ought to be moved with the caret.

Private layer

layer: Layer

The layer that holds the caret.

Private manager

manager: CaretManager

The caret manager that holds this marker.

Private pendingRefresh

pendingRefresh: boolean = false

Private scroller

scroller: Scroller

The scroller element that contains the editor document for which we are managing a caret.

Private suspended

suspended: number = 0

Accessors

inDOM

  • get inDOM(): boolean
  • Returns boolean

    True if the caret is in the DOM tree, false otherwise.

Methods

getBoundingClientRect

  • getBoundingClientRect(): ClientRect
  • Returns ClientRect

    The bounding client rectangle of the DOM element associated with this marker.

Private getPositionFromScroller

  • getPositionFromScroller(): object
  • Returns object

    The coordinates of the caret marker relative to the scroller.

    • left: number
    • top: number

refresh

  • refresh(): void
  • Refreshes the caret position on screen. If refreshing has been suspended, it records that a refresh was requested but does not actually refresh the caret.

    Returns void

resume

  • resume(): void
  • Resume refreshing the caret. This must be called the same number of times suspend was called before refreshing is actually resumed.

    This function checks whether anything called refresh while refreshing was suspended, and if so will call refresh as soon as refreshing is resumed.

    Returns void

scrollIntoView

  • scrollIntoView(): void

suspend

  • suspend(): void
  • Suspend refreshing the caret. Calling this function multiple times increases the suspension count. resume must be called an equal number of times before refreshes are resumed.

    Returns void

Generated using TypeDoc