Class gui.Caret
Defined in: Caret.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
gui.Caret(selection, rootNode)
Class that represents a caret in a document.
|
| Method Attributes | Method Name and Description |
|---|---|
|
Synchronize the cursor with the current selection.
|
Class Detail
gui.Caret(selection, rootNode)
Class that represents a caret in a document. In text nodes, a native caret is
used via the HTML attribute contentEditable. Outside of text nodes, an empty
element representing the caret is used.
- Parameters:
- selection
- rootNode
Method Detail
{undefined}
updateToSelection()
Synchronize the cursor with the current selection.
If there is a single collapsed selection range, the cursor will be placed
there. If not, the cursor will be removed from the document tree.
- Returns:
- {undefined}