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:
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:
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:
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:
trapsCursorstatic
#
Whether a node traps the cursor when active, e.g. in table cells
Properties:
Type | Description |
---|---|
boolean |
- Source:
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
canContainContent()
#
- Source:
- See:
canHaveChildren()
#
- Source:
- See:
canHaveChildrenNotContent()
#
- Source:
- See:
destroy()
#
Release all memory.
- Overrides:
- Source:
getChildNodeTypes()
#
- Source:
- See:
getLength()
#
- Source:
- See:
getModel() → {ve.dm.Model}
#
Get the model the view observes.
- Inherited from:
- Source:
Returns:
Model the view observes
- Type
- ve.dm.Model
getModelHtmlDocument() → {HTMLDocument}
#
getOffset()
#
- Source:
- See:
getOuterLength()
#
- Source:
- See:
getParentNodeTypes()
#
- Source:
- See:
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
getSuggestedParentNodeTypes()
#
- Source:
- See:
handlesOwnChildren()
#
- Source:
- See:
hasSignificantWhitespace()
#
- Source:
- See:
initialize()
#
Initialize this.$element. This is called by the constructor and should be called every time this.$element is replaced.
- Inherited from:
- Source:
isAlignable()
#
- Source:
- See:
isCellEditable()
#
- Source:
- See:
isCellable()
#
- Source:
- See:
isContent()
#
- Source:
- See:
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()
#
- Source:
- See:
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
isMetaData()
#
- Source:
- See:
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
isUnwrappable()
#
- Source:
- See:
isWrapped()
#
- Source:
- See:
onSetup()
#
Handle setup event.
- Inherited from:
- Source:
onTeardown()
#
Handle teardown event.
- Inherited from:
- Source:
removeEmptyLastChildOnEnter() → {boolean}
#
Check if the node removes its empty last child on 'enter'.
- Source:
Returns:
Node removes empty last child on 'enter'
- Type
- boolean
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:
shouldIgnoreChildren()
#
- Source:
- See:
splitOnEnter() → {boolean}
#
Check if the node can be split.
- Source:
Returns:
Node can be split
- Type
- boolean
trapsCursor() → {boolean}
#
Check if the node traps cursor when active
- Source:
Returns:
Node traps cursor
- Type
- boolean
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
Events
setup()
#
- Inherited from:
- Source:
teardown()
#
- Inherited from:
- Source: