ResizeState (widget/widgetresize)
@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate
Stores the internal state of a single resizable object.
Filtering
Properties
-
activeHandlePosition : String | null
module:widget/widgetresize/resizerstate~ResizeState#activeHandlePosition
readonly observable
The position of the handle that initiated the resizing. E.g.
"top-left"
,"bottom-right"
etc. ornull
if unknown. -
aspectRatio : Number
module:widget/widgetresize/resizerstate~ResizeState#aspectRatio
readonly
A width to height ratio of the resized image.
-
originalHeight : Number
module:widget/widgetresize/resizerstate~ResizeState#originalHeight
readonly
The original height (pixels) of the resized object when the resize process was started.
-
originalWidth : Number
module:widget/widgetresize/resizerstate~ResizeState#originalWidth
readonly
The original width (pixels) of the resized object when the resize process was started.
-
originalWidthPercents : Number
module:widget/widgetresize/resizerstate~ResizeState#originalWidthPercents
readonly
The original width (percents) of the resized object when the resize process was started.
-
proposedHeightPixels : Number | null
module:widget/widgetresize/resizerstate~ResizeState#proposedHeightPixels
readonly observable
The height (pixels) proposed, but not committed yet, in the current resize process.
-
proposedWidthPercents : Number | null
module:widget/widgetresize/resizerstate~ResizeState#proposedWidthPercents
readonly observable
The width (percents) proposed, but not committed yet, in the current resize process.
-
proposedWidthPixels : Number | null
module:widget/widgetresize/resizerstate~ResizeState#proposedWidthPixels
readonly observable
The width (pixels) proposed, but not committed yet, in the current resize process.
-
_options : ResizerOptions
module:widget/widgetresize/resizerstate~ResizeState#_options
private
-
_referenceCoordinates : Object
module:widget/widgetresize/resizerstate~ResizeState#_referenceCoordinates
private
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 )
module:widget/widgetresize/resizerstate~ResizeState#constructor
Parameters
options : ResizerOptions
Resizer options.
-
begin( domResizeHandle, domHandleHost, domResizeHost )
module:widget/widgetresize/resizerstate~ResizeState#begin
Parameters
domResizeHandle : HTMLElement
The handle used to calculate the reference point.
domHandleHost : HTMLElement
domResizeHost : HTMLElement
Events
-
change:activeHandlePosition( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:activeHandlePosition
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 ornull
, if operation should remove property.oldValue : String | null
Old value of the
activeHandlePosition
property with given key ornull
, if property was not set before.
-
change:proposedHeightPixels( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:proposedHeightPixels
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 ornull
, if operation should remove property.oldValue : Number | null
Old value of the
proposedHeightPixels
property with given key ornull
, if property was not set before.
-
change:proposedWidthPercents( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:proposedWidthPercents
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 ornull
, if operation should remove property.oldValue : Number | null
Old value of the
proposedWidthPercents
property with given key ornull
, if property was not set before.
-
change:proposedWidthPixels( eventInfo, name, value, oldValue )
module:widget/widgetresize/resizerstate~ResizeState#event:change:proposedWidthPixels
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 ornull
, if operation should remove property.oldValue : Number | null
Old value of the
proposedWidthPixels
property with given key ornull
, if property was not set before.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.