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
Returns:
Node can be take the cursor
- Type
- boolean
- Source:
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.
Returns:
Model the view observes
- Type
- ve.dm.Model
- Inherited from:
- Source:
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 |
Returns:
URL resolved according to the document's base
- Type
- string
- Inherited from:
- Source:
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.
Returns:
View is attached to the live DOM
- Type
- boolean
- Inherited from:
- Source:
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.
Returns:
Node supports multiline input
- Type
- boolean
- Source:
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'.
Returns:
Node removes empty last child on 'enter'
- Type
- boolean
- Source:
setLive(live)
#
Set live state.
Parameters:
| Name | Type | Description |
|---|---|---|
live |
boolean | The view has been attached to the live DOM (use false on detach) |
Fires:
- Inherited from:
- Source:
shouldIgnoreChildren()
#
- Source:
- See:
splitOnEnter() → {boolean}
#
Check if the node can be split.
Returns:
Node can be split
- Type
- boolean
- Source:
trapsCursor() → {boolean}
#
Check if the node traps cursor when active
Returns:
Node traps cursor
- Type
- boolean
- Source:
getDescription(node) → {string}static
#
Get a plain text description.
Parameters:
| Name | Type | Description |
|---|---|---|
node |
ve.dm.Node | Node model |
Returns:
Description of node
- Type
- string
- Source:
Events
setup()
#
- Inherited from:
- Source:
teardown()
#
- Inherited from:
- Source: