Documentation
Caret
set #
el | Node Element Dom |
Set the selection for the entire element.
this.caret.set(element);
setStart #
el | Node Element Dom |
Set the caret at the beginning of the element.
this.caret.setStart(element);
setEnd #
el | Node Element Dom |
Set the caret at the end of the element.
this.caret.setEnd(element);
setBefore #
el | Node Element Dom |
Set the caret before the element for inline tags or set at the end of a previous element for block tags.
this.caret.setBefore(element);
setAfter #
el | Node Element Dom |
Set the caret after the element for inline tags or set a at the beginning of a next element for block tags.
this.caret.setAfter(element);
isStart #
el (optional) | Node Element Dom |
Returns: Boolean
Check if the caret at the beginning of the editor or the element. Always return true
If checking the caret position in a component.
// is start of editor
var is = this.caret.isStart();
// is start of element
var is = this.caret.isStart(element);
isEnd #
el (optional) | Node Element Dom |
Returns: Boolean
Check if the caret at the end of the editor or the element. Always return true
If checking the caret position in a component.
// is end of editor
var is = this.caret.isEnd();
// is end of element
var is = this.caret.isEnd(element);