Module

widget/widgettypearound/utils

@ckeditor/ckeditor5-widget/src/widgettypearound/utils

module

Filtering

Functions

  • getClosestTypeAroundDomButton( domElement ) → HTMLElement | null

    static

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

    Parameters

    domElement : HTMLElement

    Returns

    HTMLElement | null
  • getClosestWidgetViewElement( domElement, domConverter ) → Element

    static

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

    Parameters

    domElement : HTMLElement
    domConverter : DomConverter

    Returns

    Element
  • getTypeAroundButtonPosition( domElement ) → String

    static

    For the passed 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

    String

    Either 'before' or 'after'.

  • getWidgetTypeAroundPositions( widgetViewElement ) → Array.<String>

    static

    For the passed widget view element, this helper returns an array of positions which correspond to the "tight spots" around the widget which cannot be accessed due to limitations of selection rendering in web browsers.

    Parameters

    widgetViewElement : Element

    Returns

    Array.<String>
  • isTypeAroundWidget( viewElement, modelElement, schema ) → Boolean

    static

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

    Parameters

    viewElement : Element
    modelElement : Element
    schema : Schema

    Returns

    Boolean