ckeditor5-elements / ElementToolbar
Class: ElementToolbar
Shows floating toolbars for elements, configured by the elementToolbar editor config option (see ElementToolbarDefinition): the toolbar of the closest element at the selection that matches, next to it, while the editor is focused. When toolbars match nested elements, the toolbar of the innermost one shows.
The toolbars are CKEditor's widget toolbars (WidgetToolbarRepository), as the image and table toolbars: they are placed and hidden by CKEditor, and Alt+F10 focuses them. Unlike widget toolbars, they show for any element, also when the selection is inside it, and their command buttons act on that element: "Move up" in the toolbar of a note moves the note, not the paragraph with the cursor.
Extends
Constructors
Constructor
new ElementToolbar(editor): ElementToolbar;Parameters
| Parameter | Type |
|---|---|
editor | Editor |
Returns
ElementToolbar
Inherit Doc
Inherited from
Plugin.constructor
Accessors
pluginName
Get Signature
get static pluginName(): "ElementToolbar";Returns
"ElementToolbar"
requires
Get Signature
get static requires(): readonly [typeof WidgetToolbarRepository];Returns
readonly [typeof WidgetToolbarRepository]
Methods
afterInit()
afterInit(): void;Registers the toolbars, after the other plugins registered their commands and components.
Returns
void
getElement()
getElement(element):
| ModelElement
| null;Returns the closest element at the selection that matches: the selected element, or the innermost element with the selection, or one of their ancestors. Never a root.
Parameters
| Parameter | Type |
|---|---|
element | ElementMatcher |
Returns
| ModelElement | null