Interface IContentWidget
Expand description
interface IContentWidget {
allowEditorOverflow?: boolean;
suppressMouseDown?: boolean;
afterRender?(
position: ContentWidgetPositionPreference,
coordinate: IContentWidgetRenderedCoordinate,
): void;
beforeRender?(): IDimension;
getDomNode(): HTMLElement;
getId(): string;
getPosition(): IContentWidgetPosition;
}Properties§
§§
allow Editor Overflow?: booleanRender this content widget in a location where it could overflow the editor's view dom node.
suppress Mouse Down?: booleanCall preventDefault() on mousedown events that target the content widget.
Methods§
§afterRender?(
position: ContentWidgetPositionPreference,
coordinate: IContentWidgetRenderedCoordinate,
): void
afterRender?(
position: ContentWidgetPositionPreference,
coordinate: IContentWidgetRenderedCoordinate,
): void
Optional function that is invoked after rendering the content
widget. Is being invoked with the selected position preference
or null if not rendered.
§beforeRender?(): IDimension
beforeRender?(): IDimension
Optional function that is invoked before rendering the content widget. If a dimension is returned the editor will attempt to use it.
§getDomNode(): HTMLElement
getDomNode(): HTMLElement
Get the dom node of the content widget.
§getId(): string
getId(): string
Get a unique identifier of the content widget.
§getPosition(): IContentWidgetPosition
getPosition(): IContentWidgetPosition
Get the placement of the content widget. If null is returned, the content widget will be placed off screen.
A content widget renders inline with the text and can be easily placed 'near' an editor position.