fancytree
fancytree copied to clipboard
BUG: error while adding nodes to empty tree
Steps to reproduce:
- Call removeChildren() for the root node
- Call addChildren(...) for the root node It throws an error: TypeError: Cannot call method 'appendChild' of null
jsFiddle: http://jsfiddle.net/VeqaH/7/
Can be fixed by replacing
node.li.appendChild(node.ul); //near 2403 in jquery.fancytree.js
with
if (node.li != null) {
node.li.appendChild(node.ul);
} else {
node.tree.$div.append(node.ul);
}