Expand all

ve.ui.ContentAction

Extends

Constructor

new ve.ui.ContentAction(surface, [source]) #

Content action.

Parameters:

Name Type Attributes Description
surface ve.ui.Surface

Surface to act on

source string optional
Source:
Content action.

Methods

cancel() → {boolean} #

Emit a surface cancel event

Returns:

Action was executed

Type
boolean
Source:
Emit a surface cancel event

changeDirectionality() → {boolean} #

Change directionality

Returns:

Action was executed

Type
boolean
Source:
Change directionality

focusContext() → {boolean} #

Move keyboard focus to the context menu.

Returns:

Action was executed

Type
boolean
Source:
Move keyboard focus to the context menu.

insert(content, [annotate], [collapseToEnd]) → {boolean} #

Insert content.

Parameters:

Name Type Attributes Description
content string | Array.<ve.dm.LinearData.Item>

Content to insert, can be either a string or array of data

annotate boolean optional

Content should be automatically annotated to match surrounding content

collapseToEnd boolean optional

Collapse selection to end after inserting

Returns:

Action was executed

Type
boolean
Source:
Insert content.

pasteSpecial() → {boolean} #

Paste special.

Returns:

Action was executed

Type
boolean
Source:
Paste special.

remove([key]) → {boolean} #

Remove content.

Parameters:

Name Type Attributes Description
key string optional

Trigger remove as if a key were pressed, either 'backspace' or 'delete'

Returns:

Action was executed

Type
boolean
Source:
Remove content.

select(selection) → {boolean} #

Select content.

Parameters:

Name Type Description
selection ve.dm.Selection

Returns:

Action was executed

Type
boolean
Source:
Select content.

selectAll() → {boolean} #

Select all content.

Returns:

Action was executed

Type
boolean
Source:
Select all content.

submit() → {boolean} #

Emit a surface submit event

Returns:

Action was executed

Type
boolean
Source:
Emit a surface submit event