I'm using https://github.com/mar10/fancytree/ in my project. How to get the list of leaf nodes of the fancy tree at the given moment.
You could try this pattern:
var leafNodes = [];
tree.visit(function(node){
if ( !node.hasChildren() ) {
leafNodes.push(node);
}
});