image/image/utils
@ckeditor/ckeditor5-image/src/image/utils
module
Filtering
Functions
-
insertImage( writer, model, [ attributes ] )
static
Handles inserting single file. This method unifies image insertion using
findOptimalInsertionPosition
method. -
isImage( modelElement ) → Boolean
static
Checks if the provided model element is an
image
. -
isImageAllowed( model ) → Boolean
static
Checks if image can be inserted at current model selection.
-
isImageWidget( viewElement ) → Boolean
static
Checks if a given view element is an image widget.
-
isImageWidgetSelected( selection ) → Boolean
static
Checks if an image widget is the only selected element.
-
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 : DowncastWriter
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