Expand all

abstract ve.ce.ResizableNode

Constructor

new ve.ce.ResizableNode([$resizable], [config])abstract #

ContentEditable resizable node.

Parameters:

Name Type Attributes Default Description
$resizable jQuery optional
this.$element

Resizable DOM element

config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
snapToGrid number | null optional
10

Snap to a grid of size X when the shift key is held. Null disables.

outline boolean optional
false

Resize using an outline of the element only, don't live preview.

showSizeLabel boolean optional
true

Show a label with the current dimensions while resizing

showScaleLabel boolean optional
true

Show a label with the current scale while resizing

Source:
ContentEditable resizable node.

Methods

getAttributeChanges(width, height) → {Object} #

Generate an object of attributes changes from the new width and height.

Parameters:

Name Type Description
width number

New image width

height number

New image height

Source:

Returns:

Attribute changes

Type
Object
Generate an object of attributes changes from the new width and height.

getResizableOffset() → {Object} #

Get and cache the relative offset of the $resizable node

Source:

Returns:

Position coordinates, containing top & left

Type
Object
Get and cache the relative offset of the $resizable node

hideSizeLabel() #

Hide the size label

Source:
Hide the size label

isResizable() → {boolean} #

Check if the node is resizable in its current state

Source:

Returns:

The node is currently resizable

Type
boolean
Check if the node is resizable in its current state

onDocumentMouseMove(e) #

Handle body mousemove.

Parameters:

Name Type Description
e jQuery.Event

Click event

Source:

Fires:

Handle body mousemove.

onDocumentMouseUp() #

Handle body mouseup.

onResizableAlign(align) #

Respond to AlignableNodes changing their alignment by hiding useless resize handles.

Parameters:

Name Type Description
align string

Alignment

Source:
Respond to AlignableNodes changing their alignment by hiding useless resize handles.

onResizableAttributeChange(key, from, to) #

Handle attribute change events from the model.

Parameters:

Name Type Description
key string

Attribute key

from string

Old value

to string

New value

Source:
Handle attribute change events from the model.

onResizableBlur() #

Handle node blur.

Source:
Handle node blur.

onResizableFocus() #

Handle node focus.

Source:
Handle node focus.

onResizableResizing(dimensions) #

Handle resizing event.

Parameters:

Name Type Description
dimensions Object

Dimension object containing width & height

Source:
Handle resizing event.

onResizableSetup() #

Handle setup event.

Source:
Handle setup event.

onResizableTeardown() #

Handle teardown event.

Source:
Handle teardown event.

onResizeHandlesCornerMouseDown(e) #

Handle bounding box handle mousedown.

Parameters:

Name Type Description
e jQuery.Event

Click event

Source:

Fires:

Handle bounding box handle mousedown.

setOriginalDimensions(dimensions) #

Set the original dimensions of the scalable object

Parameters:

Name Type Description
dimensions Object
Source:
Set the original dimensions of the scalable object

setResizableHandlesPosition() #

Set the proper position for resize handles

Source:
Set the proper position for resize handles

setResizableHandlesSizeAndPosition() #

Set the proper size and position for resize handles

Source:
Set the proper size and position for resize handles

showHandles([handles]) #

Show specific resize handles

Parameters:

Name Type Attributes Description
handles Array.<string> optional

List of handles to show: 'nw', 'ne', 'sw', 'se'. Show all if undefined.

Source:
Show specific resize handles

updateSizeLabel() #

Update the contents and position of the size label

Source:
Update the contents and position of the size label

Events

resizeEnd() #

resizeStart() #

resizing(dimensions) #

Parameters:

Name Type Description
dimensions Object

Dimension object containing width & height

Source: