eZ.AlloyEditorButton.ButtonLinkEdit Class
The ButtonLinkEdit class provides functionality for creating and editing a link in a document.
Note: This component overrides the one provided by AlloyEditor by default to give more options and improve the UI.
Item Index
Methods
Methods
_clearLink
()
protected
Clears the link input. This only changes the component internal state, but does not affect the link element of the editor. Only the _removeLink and _updateLink methods are translated to the editor element.
_focusEditedLink
()
protected
Gives the focus to the edited link by moving the caret in it.
_handleKeyDown
-
event
Monitors key interaction inside the input element to respond to the keys:
- Enter: Creates/updates the link.
- Escape: Discards the changes.
Parameters:
-
event
SyntheticEventThe keyboard event.
_removeLink
()
protected
Removes the link in the editor element.
_saveLink
()
protected
Saves the link with the current href, title and target.
_selectContent
()
protected
Runs the Universal Discovery Widget so that the user can pick a Content.
_setHref
-
event
Updates the component state when the link input changes on user interaction.
Parameters:
-
event
SyntheticEventThe change event.
_updateLink
()
protected
Updates the link in the editor element. If the element didn't exist previously, it will create a new element with the href specified in the link input.
getInitialState
()
Lifecycle. Invoked once before the component is mounted. The return value will be used as the initial value of this.state.
render
()
Object
Lifecycle. Renders the UI of the button.
Returns:
The content which should be rendered.
Properties
editor
Object
The editor instance where the component is being used.
key
String
static
The name which will be used as an alias of the button in the configuration.
Default: linkEdit