mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 18:03:25 +02:00
48ac2271f9
Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com> Co-authored-by: Petr Savchenko <specc.dev@gmail.com> Co-authored-by: George Berezhnoy <gohabereg@gmail.com> Co-authored-by: Taly Guryn <vitalik7tv@yandex.ru>
979 B
979 B
CodeX Editor Caret Module
The Caret
module contains methods working with caret. Uses Range methods to navigate caret
between blocks.
Caret class implements basic Module class that holds User configuration and default CodeX Editor instances
Properties
Methods
setToBlock
Caret.setToBlock(block, offset, atEnd)
Method gets Block instance and puts caret to the text node with offset
params
Param | Type | Description |
---|---|---|
block | Object | Block instance that BlockManager created |
offset | Number | caret offset regarding to the text node (Default: 0) |
atEnd | Boolean | puts caret at the end of last text node |
setToTheLastBlock
Caret.setToTheLastBlock()
sets Caret at the end of last Block If last block is not empty, inserts another empty Block which is passed as initial