Documentation
Offset
get
element (optional) | Node , Element , Dom |
Returns the object with the selection offset (start and end). Return false if the focus is not in the editor or is not in the specified element.
The editor selection offset:
var offset = this.app.offset.get();
console.log(offset.start, offset.end);
The element selection offset:
var offset = this.app.offset.get(element);
console.log(offset.start, offset.end);
set
element | Node , Element , Dom , Boolean | |
value | Object |
Sets the selection in the editor or in the element by the specified object.
Set the editor offset:
this.app.offset.set(false, { start: 1, end: 10 });
Set the element offset:
this.app.offset.set(element, { start: 1, end: 10 });
dkjgvo65776inru43654