Expand all

abstract ve.ce.Node

Extends

Constructor

new ve.ce.Node(model, [config])abstract #

Generic ContentEditable node.

Parameters:

Name Type Attributes Description
model ve.dm.Node

Model to observe

config Object optional

Configuration options

Mixes in:
Source:
Generic ContentEditable node.

Properties

autoFocusstatic #

Whether a node can take the cursor when its surface is focused

When set to false, this will prevent the selection from being placed in any of the node's descendant ContentBranchNodes.

Properties:

Type Description
boolean
Source:

Whether a node can take the cursor when its surface is focused

When set to false, this will prevent the selection from being placed in any of the node's descendant ContentBranchNodes.

isMultilinestatic #

Whether a node supports multiline input at all.

If set to false, pressing Enter will not perform any splitting at all. If set to null, traverse up the tree until a boolean value is found.

Properties:

Type Description
boolean | null
Source:
Whether a node supports multiline input at all.

removeEmptyLastChildOnEnterstatic #

Whether Enter removes the empty last child of this node.

Set true on the parent of a splitOnEnter node (e.g. a ListNode) to ensure that the last splittable child (e.g a ListItemNode) is removed when empty and enter is pressed.

Properties:

Type Description
boolean
Source:
Whether Enter removes the empty last child of this node.

splitOnEnterstatic #

Whether Enter splits this node type.

When the user presses Enter, we split the node they're in (if splittable), then split its parent if splittable, and continue traversing up the tree and stop at the first non-splittable node.

Properties:

Type Description
boolean
Source:
Whether Enter splits this node type.

trapsCursorstatic #

Whether a node traps the cursor when active, e.g. in table cells

Properties:

Type Description
boolean
Source:
Whether a node traps the cursor when active, e.g.

Methods

autoFocus() → {boolean} #

Check if the node can take the cursor when its surface is focused

Source:

Returns:

Node can be take the cursor

Type
boolean
Check if the node can take the cursor when its surface is focused

canContainContent() #

canHaveChildren() #

canHaveChildrenNotContent() #

destroy() #

Release all memory.

Overrides:
Source:
Release all memory.

getChildNodeTypes() #

getLength() #

getModel() → {ve.dm.Model} #

Get the model the view observes.

Inherited from:
Source:

Returns:

Model the view observes

Type
ve.dm.Model
Get the model the view observes.

getModelHtmlDocument() → {HTMLDocument} #

Get the model's HTML document

Overrides:
Source:

Returns:

Model document

Type
HTMLDocument
Get the model's HTML document

getOffset() #

getOuterLength() #

getParentNodeTypes() #

getResolvedAttribute(key) → {string} #

Get a resolved URL from a model attribute.

Parameters:

Name Type Description
key string

Attribute name whose value is a URL

Inherited from:
Source:

Returns:

URL resolved according to the document's base

Type
string
Get a resolved URL from a model attribute.

getSuggestedParentNodeTypes() #

handlesOwnChildren() #

hasSignificantWhitespace() #

initialize() #

Initialize this.$element. This is called by the constructor and should be called every time this.$element is replaced.

Inherited from:
Source:
Initialize this.$element.

isAlignable() #

isCellEditable() #

isCellable() #

isContent() #

isFocusable() #

If this is set to true it should implement:

setFocused( boolean val )
boolean isFocused()
Source:
See:

If this is set to true it should implement:

setFocused( boolean val )
boolean isFocused()

isInternal() #

isLive() → {boolean} #

Check if the view is attached to the live DOM.

Inherited from:
Source:

Returns:

View is attached to the live DOM

Type
boolean
Check if the view is attached to the live DOM.

isMetaData() #

isMultiline() → {boolean} #

Check if the node is supports multiline input.

Traverses upstream until a boolean value is found. If no value is found, reads the default from the surface.

Source:

Returns:

Node supports multiline input

Type
boolean
Check if the node is supports multiline input.

isUnwrappable() #

isWrapped() #

onSetup() #

Handle setup event.

Inherited from:
Source:
Handle setup event.

onTeardown() #

Handle teardown event.

Inherited from:
Source:
Handle teardown event.

removeEmptyLastChildOnEnter() → {boolean} #

Check if the node removes its empty last child on 'enter'.

Source:

Returns:

Node removes empty last child on 'enter'

Type
boolean
Check if the node removes its empty last child on 'enter'.

setLive(live) #

Set live state.

Parameters:

Name Type Description
live boolean

The view has been attached to the live DOM (use false on detach)

Inherited from:
Source:

Fires:

Set live state.

shouldIgnoreChildren() #

splitOnEnter() → {boolean} #

Check if the node can be split.

Source:

Returns:

Node can be split

Type
boolean
Check if the node can be split.

trapsCursor() → {boolean} #

Check if the node traps cursor when active

Source:

Returns:

Node traps cursor

Type
boolean
Check if the node traps cursor when active

getDescription(node) → {string}static #

Get a plain text description.

Parameters:

Name Type Description
node ve.dm.Node

Node model

Source:

Returns:

Description of node

Type
string
Get a plain text description.

Events

setup() #

teardown() #