commajs
Block Node
.domElement
Property that contains the dom element associated witht his node.
AddAttribute(name, value)
Add attribute to the node (including underlying dom element).
RemoveAttribute(name)
Removes attribute from node (including underlying dom element).
isBlockNode()
Returns true if node is a block node.
isInlineNode()
Returns true if node is an inline node.
isTextNode()
Returns true if node is an text node.
IsStyleApplied(styleName)
Returns true if styleName is applied to the node.
ToggleStyle(styleName, value, applyToDom=true, forceOn=false)
Toggles styleName to the node. Returns true if the style was newly applied.
GetBlockContainer()
Returns the block node containing the node
Copy()
Creates a copy of the node. Returns the node newly created.
Append(node)
Append a comma node to this node
ChangeTagName(tagName)
Function to change the tag name of a node. It will also update the HTML Dom.
static CreateNew(_document, tagName, nodeStyle=undefined, attributes=[])
Static method to create a new node.
Delete()
Delete current node from the document.
DeleteButReturnTextNodes()
Delete current node from the document and returns all Text Nodes children.
GetFirstTextNode()
Returns the first Text Node
GetLastTextNode()
Returns the last Text Node
isEmpty(node)
Returns true if it doesn't contain any Text Node with user's content
InsertEmptyBlockNodeAfter(tagName="div")
Inserts an empty Block Node after current node.
InsertEmptyBlockNodeBefore(tagName="div")
Inserts an empty Block Node before current node.
All Nodes:
.domElement
AddAttribute()
RemoveAttribute()
isBlockNode()
isInlineNode()
isTextNode()
IsStyleApplied()
ToggleStyle()
GetBlockContainer()
Copy()
Block Node:
Append()
ChangeTagNameopy()
CreateNew()
Delete()
DeleteButReturnTextNodes()
GetFirstTextNode()
GetLastTextNode()
isEmpty()
InsertEmptyBlockNodeAfter()
InsertEmptyBlockNodeBefore()
© 2020 Plugg, Inc. All rights reserved. Various trademarks held by their respective owners.
Plugg, Inc. - San Francisco, CA 94114, United States