Sign up (with export icon)

widget/widgettypearound/utils

Api-module iconmodule

Constants

Functions

  • Chevron-right icon

    getClosestTypeAroundDomButton( domElement ) → null | HTMLElement
    internal

    For the passed HTML element, this helper finds the closest widget type around button ancestor.

    Parameters

    domElement : HTMLElement

    Returns

    null | HTMLElement
  • Chevron-right icon

    getClosestWidgetViewElement( domElement, domConverter ) → ViewElement
    internal

    For the passed HTML element, this helper returns the closest view widget ancestor.

    Parameters

    domElement : HTMLElement
    domConverter : ViewDomConverter

    Returns

    ViewElement
  • Chevron-right icon

    getTypeAroundButtonPosition( domElement ) → 'after' | 'before'
    internal

    For the passed widget type around button element, this helper determines at which position the paragraph would be inserted into the content if, for instance, the button was clicked by the user.

    Parameters

    domElement : HTMLElement

    Returns

    'after' | 'before'

    The position of the button.

  • Chevron-right icon

    getTypeAroundFakeCaretPosition( selection ) → null | 'after' | 'before'
    internal

    For the passed selection instance, it returns the position of the fake caret displayed next to a widget.

    Note: If the fake caret is not currently displayed, null is returned.

    Parameters

    selection : ModelSelection | ModelDocumentSelection

    Returns

    null | 'after' | 'before'

    The position of the fake caret or null when none is present.

  • Chevron-right icon

    isTypeAroundWidget( viewElement, modelElement, schema ) → boolean

    Checks if an element is a widget that qualifies to get the widget type around UI.

    Parameters

    viewElement : undefined | ViewElement
    modelElement : ModelElement
    schema : ModelSchema

    Returns

    boolean