ckeditor5-elements / ElementBreadcrumbs
Class: ElementBreadcrumbs
Shows the data view structure at the current selection (the elements of the editor data, as in getData()), e.g. aside.note › p, ul › li or figure.table › table › tbody › tr › td.
Inline elements are items, as any element. CKEditor's text attributes, marks on the text such as its <strong>, are skipped. The selected element, e.g. an image, is the innermost item.
Place them in a toolbar as the breadcrumbs component, or anywhere else using a view from createView.
Clicking is configured only by the elementBreadcrumbs.menu editor config option (see ElementBreadcrumbsConfig): with it, the items are buttons that open the menu of their element, with ElementMenu, as the context menu does; without it, they are labels.
The data view is converted again only when elements change, not when typing or moving the cursor. For a large document, that happens at most every 250 ms.
Extends
Constructors
Constructor
new ElementBreadcrumbs(editor): ElementBreadcrumbs;Parameters
| Parameter | Type |
|---|---|
editor | Editor |
Returns
ElementBreadcrumbs
Overrides
Plugin.constructor
Properties
items
items: readonly BreadcrumbItem[];Observable
The elements at the current selection, from the outermost to the innermost one.
Accessors
pluginName
Get Signature
get static pluginName(): "ElementBreadcrumbs";Returns
"ElementBreadcrumbs"
requires
Get Signature
get static requires(): readonly [typeof ElementMenu];Returns
readonly [typeof ElementMenu]
Methods
createView()
createView(locale?): BreadcrumbsView;Creates a breadcrumbs view that follows items.
Parameters
| Parameter | Type |
|---|---|
locale? | Locale |
Returns
destroy()
destroy(): void;Returns
void
Inherit Doc
Overrides
Plugin.destroy
init()
init(): void;Returns
void
refresh()
refresh(): void;Updates items from the current selection, converting the data view first when elements changed.
Returns
void