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
div
which 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
startNode
toroot
) in the path. -
The last element of the elements path -
startNode
or its parent. -
The root of the elements path -
root
argument passed to class constructor or abody
element.
Methods
-
constructor( startNode, root ) → elementPath
CKEDITOR.dom.elementPath#constructor
Creates an element path class instance.
Parameters
startNode : element
From which the path should start.
root : element
To which element the path should stop, defaults to the
body
element.
Returns
elementPath
-
compare( otherPath ) → Boolean
CKEDITOR.dom.elementPath#compare
Compares this element path with another one.
Parameters
otherPath : elementPath
The elementPath object to be compared with this one.
Returns
Boolean
true
if the paths are equal, containing the same number of elements and the same elements in the same order.
-
contains( query, [ excludeRoot ], [ fromTop ] ) → element
CKEDITOR.dom.elementPath#contains
Search the path elements that meets the specified criteria.
Parameters
query : String | Array | Function | Object | element
The criteria that can be either a tag name, list (array and object) of tag names, element or an node evaluator function.
[ excludeRoot ] : Boolean
Not taking path root element into consideration.
[ fromTop ] : Boolean
Search start from the topmost element instead of bottom.
Returns
element
The first matched dom element or
null
.
-
direction() → 'ltr' | 'rtl'
CKEDITOR.dom.elementPath#direction
-
isContextFor( tag ) → Boolean
CKEDITOR.dom.elementPath#isContextFor
Check whether the elements path is the proper context for the specified tag name in the DTD.
Parameters
tag : String
The tag name.
Returns
Boolean