Expand all

ve.ui.ListAction

Extends

Constructor

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

List action.

Parameters:

Name Type Attributes Description
surface ve.ui.Surface

Surface to act on

source string optional
Source:
List action.

Methods

allWrapped(style, [listType]) → {boolean} #

Check if the current selection is wrapped in a list of a given style

Parameters:

Name Type Attributes Default Description
style string | null

List style, e.g. 'number' or 'bullet', or null for any style

listType string optional
'list'

List type

Source:

Returns:

Current selection is all wrapped in a list

Type
boolean
Check if the current selection is wrapped in a list of a given style

toggle(style, noBreakpoints, [listType]) → {boolean} #

Toggle a list around content.

Parameters:

Name Type Attributes Default Description
style string

List style, e.g. 'number' or 'bullet'

noBreakpoints boolean

Don't create breakpoints

listType string optional
'list'

List type

Source:

Returns:

Action was executed

Type
boolean
Toggle a list around content.

unwrap(noBreakpoints, [listType]) → {boolean} #

Remove list around content.

TODO: Refactor functionality into {ve.dm.SurfaceFragment}.

Parameters:

Name Type Attributes Default Description
noBreakpoints boolean

Don't create breakpoints

listType string optional
'list'

List type

Source:

Returns:

Action was executed

Type
boolean
Remove list around content.

wrap(style, noBreakpoints, [listType]) → {boolean} #

Add a list around content.

TODO: Refactor functionality into {ve.dm.SurfaceFragment}.

Parameters:

Name Type Attributes Default Description
style string

List style, e.g. 'number' or 'bullet'

noBreakpoints boolean

Don't create breakpoints

listType string optional
'list'

List type

Source:

Returns:

Action was executed

Type
boolean
Add a list around content.

wrapOnce(style, noBreakpoints, [listType]) → {boolean} #

Add a list around content only if it has no list already.

Parameters:

Name Type Attributes Default Description
style string

List style, e.g. 'number' or 'bullet'

noBreakpoints boolean

Don't create breakpoints

listType string optional
'list'

List type

Source:

Returns:

Action was executed

Type
boolean
Add a list around content only if it has no list already.