CKEDITOR.dom.elementPath
Retrieve the list of nodes walked from the start node up to the editable element of the editor.
Filtering
Properties
-
First non-empty block element which:
- is not a CKEDITOR.dtd.$blockLimit,
- or is a
divwhich does not contain block elements and is not aroot.
This means a first, splittable block in elements path.
-
See the CKEDITOR.dtd.$blockLimit description.
-
An array of elements (from
startNodetoroot) in the path. -
The last element of the elements path -
startNodeor its parent. -
The root of the elements path -
rootargument passed to class constructor or abodyelement.
Methods
constructor( startNode, root ) → elementPathCKEDITOR.dom.elementPath#constructorCreates an element path class instance.
Parameters
startNode : elementFrom which the path should start.
root : elementTo which element the path should stop, defaults to the
bodyelement.Returns
elementPath
compare( otherPath ) → BooleanCKEDITOR.dom.elementPath#compareCompares this element path with another one.
Parameters
otherPath : elementPathThe elementPath object to be compared with this one.
Returns
Booleantrueif the paths are equal, containing the same number of elements and the same elements in the same order.contains( query, [ excludeRoot ], [ fromTop ] ) → elementCKEDITOR.dom.elementPath#containsSearch the path elements that meets the specified criteria.
Parameters
query : String | Array | Function | Object | elementThe criteria that can be either a tag name, list (array and object) of tag names, element or an node evaluator function.
[ excludeRoot ] : BooleanNot taking path root element into consideration.
[ fromTop ] : BooleanSearch start from the topmost element instead of bottom.
Returns
elementThe first matched dom element or
null.direction() → 'ltr' | 'rtl'CKEDITOR.dom.elementPath#directionisContextFor( tag ) → BooleanCKEDITOR.dom.elementPath#isContextForCheck whether the elements path is the proper context for the specified tag name in the DTD.
Parameters
tag : StringThe tag name.
Returns
Boolean