Expand all

abstract ve.ce.BranchNode

Properties

blockSlugTemplatestatic #

Block slug template.

Properties:

Type Description
HTMLElement
Source:
Block slug template.

inlineSlugTemplatestatic #

Inline slug template.

Properties:

Type Description
HTMLElement
Source:
Inline slug template.

inputDebugInlineSlugTemplatestatic #

Inline slug template for input debugging.

Properties:

Type Description
HTMLElement
Source:
Inline slug template for input debugging.

Methods

autoFocus() → {boolean} #

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

Inherited from:
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() #

getDomPosition(offset) → {ve.ce.NodeAndOffset} #

Get the DOM position (node and offset) corresponding to a position in this node

The node/offset have the same semantics as a DOM Selection focusNode/focusOffset

Parameters:

Name Type Description
offset number

The offset inside this node of the required position

Source:

Returns:

The DOM position; guaranteed to be this node's final DOM node

Type
ve.ce.NodeAndOffset

Get the DOM position (node and offset) corresponding to a position in this node

The node/offset have the same semantics as a DOM Selection focusNode/focusOffset

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

Inherited from:
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.

getSlugAtOffset(offset) → {HTMLElement|null} #

Get a slug at an offset.

Parameters:

Name Type Description
offset number

Offset to get slug at

Source:

Returns:

Type
HTMLElement | null
Get a slug at an offset.

getSuggestedParentNodeTypes() #

handlesOwnChildren() #

hasSignificantWhitespace() #

initialize() #

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

Overrides:
Source:
Initialize this.$element.

isAlignable() #

isCellEditable() #

isCellable() #

isContent() #

isFocusable() #

If this is set to true it should implement:

setFocused( boolean val )
boolean isFocused()
Inherited from:
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.

Inherited from:
Source:

Returns:

Node supports multiline input

Type
boolean
Check if the node is supports multiline input.

isUnwrappable() #

isWrapped() #

onModelUpdate(transaction) #

Handles model update events.

Parameters:

Name Type Description
transaction ve.dm.Transaction
Source:
Handles model update events.

onSetup() #

Handle setup event.

Inherited from:
Source:
Handle setup event.

onSlugClick(slugNode) #

Handle slug click events

Parameters:

Name Type Description
slugNode HTMLElement

Slug node clicked

Source:
Handle slug click events

onSplice(index, deleteCount, […modelNodes]) #

Handle splice events.

ve.ce.Node objects are generated from the inserted ve.dm.Node objects, producing a view that's a mirror of its model.

Parameters:

Name Type Attributes Description
index number

Index to remove and or insert nodes at

deleteCount number

Number of nodes to remove

modelNodes ve.dm.BranchNode optional
repeatable

Variadic list of nodes to insert

Source:
Handle splice events.

onTeardown() #

Handle teardown event.

Inherited from:
Source:
Handle teardown event.

removeEmptyLastChildOnEnter() → {boolean} #

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

Inherited from:
Source:

Returns:

Node removes empty last child on 'enter'

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

removeSlugs() #

Remove all slugs in this branch

Source:
Remove all slugs in this branch

setLive(live) #

Set live state on child nodes.

Parameters:

Name Type Description
live boolean

New live state

Overrides:
Source:
Set live state on child nodes.

setupBlockSlugs() #

Setup block slugs

Source:
Setup block slugs

setupInlineSlugs() #

Setup inline slugs

Source:
Setup inline slugs

setupSlugs(isBlock) #

Setup slugs where needed.

Existing slugs will be removed before new ones are added.

Parameters:

Name Type Description
isBlock boolean

Set up block slugs, otherwise setup inline slugs

Source:
Setup slugs where needed.

shouldIgnoreChildren() #

splitOnEnter() → {boolean} #

Check if the node can be split.

Inherited from:
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

Inherited from:
Source:

Returns:

Node traps cursor

Type
boolean
Check if the node traps cursor when active

updateTagName() #

Update the DOM wrapper.

WARNING: The contents, .data( 'view' ), the contentEditable property and any classes the wrapper already has will be moved to the new wrapper, but other attributes and any other information added using $.data() will be lost upon updating the wrapper. To retain information added to the wrapper, subscribe to the 'teardown' and 'setup' events, or override #initialize.

Source:

Fires:

Update the DOM wrapper.

Events

setup() #

teardown() #