Editor.DOM Class
DOM utility methods for Editor.Base
Item Index
Methods
- copyStyles
- isElementNode static
- isEmptyNode static
- isTextNode static
- maxOffset static
- split
Methods
copyStyles
-
from
-
to
-
styles
-
[options]
Copies styles from a node to another node
Parameters:
-
from
HTMLElement | Node -
to
HTMLElement | Node -
styles
Array -
[options]
Object optional
isElementNode
-
node
Returns true if the given node is an element node, false otherwise
Parameters:
-
node
HTMLNode | Node
Returns:
true if the given node is an element node, false otherwise
isEmptyNode
-
node
Returns true if the given node is empty
Nodes containing only returns, tabs or linefeeds are considered empty Nodes containing only whitespace or breaks (br) are not considered empty
Parameters:
-
node
HTMLNode | Node
Returns:
true if the given node is a empty, false otherwise
isTextNode
-
node
Returns true if the given node is a text node, false otherwise
Parameters:
-
node
HTMLNode | Node
Returns:
true if the given node is a text node, false otherwise
maxOffset
-
node
Returns the maximum offset of a given node as determined by the type of node.
Element nodes will return the number of childNodes Text nodes will return the length of the text
Parameters:
-
node
HTMLNode | Node
Returns:
Number of child nodes or length of text