Extends
Constructor
new ve.ui.ListAction(surface, [source])
#
Hierarchy
List action.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
surface |
ve.ui.Surface | Surface to act on |
|
source |
string |
optional |
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 |
Returns:
Current selection is all wrapped in a list
- Type
- boolean
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 |
Returns:
Action was executed
- Type
- boolean
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 |
Returns:
Action was executed
- Type
- boolean
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 |
Returns:
Action was executed
- Type
- boolean
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 |
Returns:
Action was executed
- Type
- boolean