Report an issue
Module

image/image/utils

@ckeditor/ckeditor5-image/src/image/utils

module

Filtering

Functions

  • isImage( modelElement ) → Boolean

    static

    Checks if the provided model element is an instance of Element and its name is image.

    Parameters

    modelElement : Element

    Returns

    Boolean
  • isImageWidget( viewElement ) → Boolean

    static

    Checks if a given view element is an image widget.

    Parameters

    viewElement : Element

    Returns

    Boolean
  • isImageWidgetSelected( selection ) → Boolean

    static

    Checks if an image widget is the only selected element.

    Parameters

    selection : Selection | DocumentSelection

    Returns

    Boolean
  • toImageWidget( viewElement, writer, label ) → Element

    static

    Converts a given Element to an image widget:

    • Adds a custom property allowing to recognize the image widget element.
    • Calls the toWidget function with the proper element's label creator.

    Parameters

    viewElement : Element
    writer : Writer

    An instance of the view writer.

    label : String

    The element's label. It will be concatenated with the image alt attribute if one is present.

    Returns

    Element