Expand all

abstract ve.ce.Selection

Constructor

new ve.ce.Selection(model, surface)abstract #

Parameters:

Name Type Description
model ve.dm.Selection

Selection model

surface ve.ce.Surface

Surface view

Source:

Properties

getDirectionalityabstract #

Get the block directionality of the selection

Note: This is not the direction of the selection (e.g. ve.Range#isBackwards); it is the computed block-level CSS directionality. The actual directionality at any point within the selection depends on both this and the browser's implementation of BIDI algorithm.

Source:

Get the block directionality of the selection

Note: This is not the direction of the selection (e.g.

getSelectionBoundingRectabstract #

Get the coordinates of the selection's bounding rectangle relative to the surface.

Source:
Get the coordinates of the selection's bounding rectangle relative to the surface.

getSelectionRectsabstract #

Get the rectangles of the selection relative to the surface.

Source:
Get the rectangles of the selection relative to the surface.

isFocusedNodeabstract #

Check if the selection covers a focused node

Source:
Check if the selection covers a focused node

isNativeCursorabstract #

Check if the selection is a native cursor selection

Source:
Check if the selection is a native cursor selection

Methods

equals(other) → {boolean} #

Check if two selections are equal

Parameters:

Name Type Description
other ve.ce.Selection

Other selection

Source:

Returns:

Selections are equal

Type
boolean
Check if two selections are equal

getModel() → {ve.dm.Selection} #

Get the selection model

Source:

Returns:

Selection model

Type
ve.dm.Selection
Get the selection model

getSelectionFocusRect() → {Object|null} #

Get the rectangle for the selection's focus end

The default gives the bounding rectangle after using collapseToTo.

Source:

Returns:

Selection rectangle

Type
Object | null

Get the rectangle for the selection's focus end

The default gives the bounding rectangle after using collapseToTo.

getSelectionStartAndEndRects() → {Object.<string, Object>|null}abstract #

Get the start and end rectangles of the selection relative to the surface.

Source:

Returns:

Start and end selection rectangles

Type
Object.<string, Object> | null
Get the start and end rectangles of the selection relative to the surface.

getSurface() → {ve.ce.Surface} #

Get the surface view this selection exists on

Source:

Returns:

Surface view

Type
ve.ce.Surface
Get the surface view this selection exists on

newFromModel(model, surface) → {ve.ce.Selection}static #

Create a new selection view from a selection model

Parameters:

Name Type Description
model ve.dm.Selection

Selection model

surface ve.ce.Surface

Surface view

Source:

Returns:

Selection view

Type
ve.ce.Selection
Create a new selection view from a selection model