A content widget renders inline with the text and can be easily placed 'near' an editor position.

interface IContentWidget {
    allowEditorOverflow?: boolean;
    suppressMouseDown?: boolean;
    afterRender?(position): void;
    beforeRender?(): IDimension;
    getDomNode(): HTMLElement;
    getId(): string;
    getPosition(): IContentWidgetPosition;
}

Properties

allowEditorOverflow?: boolean

Render this content widget in a location where it could overflow the editor's view dom node.

suppressMouseDown?: boolean

Call preventDefault() on mousedown events that target the content widget.

Methods

  • Optional function that is invoked after rendering the content widget. Is being invoked with the selected position preference or null if not rendered.

    Returns void

  • Optional function that is invoked before rendering the content widget. If a dimension is returned the editor will attempt to use it.

    Returns IDimension

  • Get the dom node of the content widget.

    Returns HTMLElement

  • Get a unique identifier of the content widget.

    Returns string