Extends
Constructor
new ve.ui.LinkContextItem(context, model, [config])
#
Hierarchy
Context item for a link.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
context |
ve.ui.LinearContext | Context the item is in |
|
model |
ve.dm.Model | Model the item is related to |
|
config |
Object |
optional |
Configuration options |
Methods
applyToAnnotations(callback)
#
Apply a callback to every modelClass annotation in the current fragment
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | Callback, will be passed fragment and annotation |
- Inherited from:
- Source:
equals(other) → {boolean}
#
Check whether this context item represents the same content as another
Parameters:
Name | Type | Description |
---|---|---|
other |
ve.ui.ContextItem |
- Inherited from:
- Source:
Returns:
- Type
- boolean
getAnnotationView() → {ve.ce.Annotation|undefined
}
#
undefined
}
#
Find the CE view for the annotation related to this context item
Problem: Going from the model to the view is difficult, as there can be many views of any given model. Assumption: an active annotation context item must mean the focus is within the relevant annotation.
- Inherited from:
- Source:
Returns:
The annotation view, if it's found, or undefined if not
- Type
-
ve.ce.Annotation
|
undefined
Find the CE view for the annotation related to this context item
Problem: Going from the model to the view is difficult, as there can be many views of any given model.
getCommand() → {ve.ui.Command}
#
getDescription() → {string}
#
Get the description.
- Overrides:
- Source:
Returns:
Item description
- Type
- string
getFragment() → {ve.dm.SurfaceFragment}
#
Get a surface fragment covering the related model node, or the current selection otherwise
- Inherited from:
- Source:
Returns:
Surface fragment
isClearable() → {boolean}
#
Check if item is clearable.
- Inherited from:
- Source:
Returns:
Item is clearable
- Type
- boolean
isEditable() → {boolean}
#
Check if item is editable.
- Inherited from:
- Source:
Returns:
Item is editable
- Type
- boolean
isNode() → {boolean}
#
Check if model is a node
- Inherited from:
- Source:
Returns:
Model is a node
- Type
- boolean
isReadOnly() → {boolean}
#
Check if the context's surface is readOnly
- Inherited from:
- Source:
Returns:
Context's surface is readOnly
- Type
- boolean
onClearButtonClick()protected
#
Handle clear button click events.
- Inherited from:
- Source:
onEditButtonClick()protected
#
Handle edit button click events.
- Inherited from:
- Source:
Fires:
onLabelButtonClick()protected
#
Handle label-edit button click events.
renderBody()
#
Render the body.
setup(refreshing) → {ve.ui.ContextItem}chainable
#
Setup the item.
Parameters:
Name | Type | Description |
---|---|---|
refreshing |
boolean | If this is a reconstruction/refresh of a context |
- Inherited from:
- Source:
Returns:
- Type
- ve.ui.ContextItem
teardown() → {ve.ui.ContextItem}chainable
#
updateLabelPreview()protected
#
Set the preview of the label
Events
command()
#
The context executed a ve.ui.Command
- Inherited from:
- Source: