mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Check for null parent in getPath
This commit is contained in:
parent
923a0efd1a
commit
3ff9a46ea9
3 changed files with 9 additions and 13 deletions
|
@ -263,12 +263,10 @@ function isOrContains ( parent, node ) {
|
|||
}
|
||||
|
||||
function getPath ( node, root ) {
|
||||
var parent = node.parentNode,
|
||||
path, id, className, classNames, dir;
|
||||
if ( node === root ) {
|
||||
path = '';
|
||||
} else {
|
||||
path = getPath( parent, root );
|
||||
var path = '';
|
||||
var id, className, classNames, dir;
|
||||
if ( node && node !== root ) {
|
||||
path = getPath( node.parentNode, root );
|
||||
if ( node.nodeType === ELEMENT_NODE ) {
|
||||
path += ( path ? '>' : '' ) + node.nodeName;
|
||||
if ( id = node.id ) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -92,12 +92,10 @@ function isOrContains ( parent, node ) {
|
|||
}
|
||||
|
||||
function getPath ( node, root ) {
|
||||
var parent = node.parentNode,
|
||||
path, id, className, classNames, dir;
|
||||
if ( node === root ) {
|
||||
path = '';
|
||||
} else {
|
||||
path = getPath( parent, root );
|
||||
var path = '';
|
||||
var id, className, classNames, dir;
|
||||
if ( node && node !== root ) {
|
||||
path = getPath( node.parentNode, root );
|
||||
if ( node.nodeType === ELEMENT_NODE ) {
|
||||
path += ( path ? '>' : '' ) + node.nodeName;
|
||||
if ( id = node.id ) {
|
||||
|
|
Loading…
Reference in a new issue