Class

ResizeState (widget/widgetresize)

@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate

class

Stores the internal state of a single resizable object.

Filtering

Properties

  • readonly observable

    activeHandlePosition : String | null

    The position of the handle that initiated the resizing. E.g. "top-left", "bottom-right" etc. or null if unknown.

  • readonly

    aspectRatio : Number

    A width to height ratio of the resized image.

  • readonly

    originalHeight : Number

    The original height (pixels) of the resized object when the resize process was started.

  • readonly

    originalWidth : Number

    The original width (pixels) of the resized object when the resize process was started.

  • readonly

    originalWidthPercents : Number

    The original width (percents) of the resized object when the resize process was started.

  • readonly observable

    proposedHeightPixels : Number | null

    The height (pixels) proposed, but not committed yet, in the current resize process.

  • readonly observable

    proposedWidthPercents : Number | null

    The width (percents) proposed, but not committed yet, in the current resize process.

  • readonly observable

    proposedWidthPixels : Number | null

    The width (pixels) proposed, but not committed yet, in the current resize process.

  • private

    _options : ResizerOptions

  • private

    _referenceCoordinates : Object

    The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor traveled, so how much the image should be enlarged. This information is only known after the DOM was rendered, so it will be updated later.

Methods

  • constructor( options )

    Parameters

    options : ResizerOptions

    Resizer options.

  • begin( domResizeHandle, domHandleHost, domResizeHost )

    Parameters

    domResizeHandle : HTMLElement

    The handle used to calculate the reference point.

    domHandleHost : HTMLElement
    domResizeHost : HTMLElement

Events

  • change:activeHandlePosition( eventInfo, name, value, oldValue )

    Fired when the activeHandlePosition property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (activeHandlePosition).

    value : String | null

    New value of the activeHandlePosition property with given key or null, if operation should remove property.

    oldValue : String | null

    Old value of the activeHandlePosition property with given key or null, if property was not set before.

  • change:proposedHeightPixels( eventInfo, name, value, oldValue )

    Fired when the proposedHeightPixels property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (proposedHeightPixels).

    value : Number | null

    New value of the proposedHeightPixels property with given key or null, if operation should remove property.

    oldValue : Number | null

    Old value of the proposedHeightPixels property with given key or null, if property was not set before.

  • change:proposedWidthPercents( eventInfo, name, value, oldValue )

    Fired when the proposedWidthPercents property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (proposedWidthPercents).

    value : Number | null

    New value of the proposedWidthPercents property with given key or null, if operation should remove property.

    oldValue : Number | null

    Old value of the proposedWidthPercents property with given key or null, if property was not set before.

  • change:proposedWidthPixels( eventInfo, name, value, oldValue )

    Fired when the proposedWidthPixels property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (proposedWidthPixels).

    value : Number | null

    New value of the proposedWidthPixels property with given key or null, if operation should remove property.

    oldValue : Number | null

    Old value of the proposedWidthPixels property with given key or null, if property was not set before.