Class: Position

Position

new Position()

A position is a logical location (zero-width, or "collapsed") in a post, typically between two characters in a section. Two positions (a head and a tail) make up a Range.

Source:

Members

offset

Properties:
Name Type Description
offset number
Source:

section

Properties:
Name Type Description
section Section
Source:

Methods

(static) atPoint(x, y, editor) → {Position|null}

Parameters:
Name Type Description
x integer

x-position in current viewport

y integer

y-position in current viewport

editor Editor
Source:
Returns:
Type
Position | null

move(units) → {Position}

Move the position 1 unit in direction.

Parameters:
Name Type Description
units Number

to move. > 0 moves right, < 0 moves left

Source:
Returns:

Return a new position one unit in the given direction. If the position is moving left and at the beginning of the post, the same position will be returned. Same if the position is moving right and at the end of the post.

Type
Position