Expand all

abstract ve.ce.ImageNode

Constructor

new ve.ce.ImageNode($figure, [$image], [config])abstract #

ContentEditable image node.

Parameters:

Name Type Attributes Description
$figure jQuery

Image or figure element

$image jQuery optional

Actual image element, if $figure is just a container

config Object optional

Configuration options

Mixes in:
Source:
ContentEditable image node.

Properties

deleteCommandName #

Command to execute when Delete or Backspace is pressed while this node is focused.

Properties:

Type Description
string | null
Mixes in:
Source:
Command to execute when Delete or Backspace is pressed while this node is focused.

iconWhenInvisible #

Icon to use when the rendering is considered not visible, as defined in #hasRendering

No icon is show if null.

Properties:

Type Description
string | null
Mixes in:
Source:

Icon to use when the rendering is considered not visible, as defined in #hasRendering

No icon is show if null.

pendingInvisibleIconChecksprivate #

Focusable nodes queued for a batched invisible-icon check. #hasRendering reads offsetWidth, forcing a reflow, so measuring per node during a bulk insert of many focusable nodes is O(N) forced layouts; batching does one reflow instead (bad on error-heavy pages and slow devices).

A single shared queue across all subclasses.

Properties:

Type Description
Set
Mixes in:
Source:
Focusable nodes queued for a batched invisible-icon check.

primaryCommandName #

Command to execute when Enter is pressed while this node is focused, or when the node is double-clicked.

Properties:

Type Description
string | null
Mixes in:
Source:
Command to execute when Enter is pressed while this node is focused, or when the node is double-clicked.

Methods

flushInvisibleIconChecks()private #

Measure and update all queued nodes with a single reflow, by grouping reads: detach every icon, then measure every node, then apply the results.

Mixes in:
Source:

Measure and update all queued nodes with a single reflow, by grouping reads: detach every icon, then measure every node, then apply the results.

getRectsForElement($element, [relativeRect]) → {Object} #

Get rects for an element

Parameters:

Name Type Attributes Description
$element jQuery

Element to get highlights

relativeRect Object optional

Rect with top & left to get position relative to

Returns:

Object containing rects and boundingRect

Type
Object
Mixes in:
Source:
Get rects for an element

onAttributeChange(key, from, to) #

Update the rendering of the 'align', src', 'width' and 'height' attributes when they change in the model.

Parameters:

Name Type Description
key string

Attribute key

from string

Old value

to string

New value

Source:

Update the rendering of the 'align', src', 'width' and 'height' attributes when they change in the model.

onLoad(e) #

Handle the image load

Parameters:

Name Type Description
e jQuery.Event

Load event

Source:
Handle the image load

getDescription()static #