templates/zebra/src/js/app.helper.js
function getTreeLineImgs(levels, treeNode, hasChildren, lastNodeLevels) {
        // this will be checked and src might be changed to img/tree-last.png if
        // this is the last item of a tree node.

        var imgs = [];

        // if this has children, we'll add a tree-parent line but should be
        // absolutely positioned right below the badge.
        if (hasChildren) imgs = [getTreeLine('parent', 'absolute')];

        if (treeNode === 'first') {
            // if first but level > 1, treat this as tree-node (not first).
            if (levels > 1) return getTreeLineImgs(levels, 'node', hasChildren);
        } else {
            // badge node
            imgs.unshift(getTreeLine(treeNode));
        }

        // deeper levels, if any...
        var deeps = [];
        if (levels > 2) {
            var i;
            for (i = 2; i < levels; i++) {
                // if parent symbol is the last in tree, we add space instead of
                // a deeper tree line.
                if (i <= lastNodeLevels) {
                    // add spaces to most-left with unshift
                    deeps.unshift(getTreeLine('space'));
                } else {
                    deeps.push(getTreeLine('deep'));
                }
            }
        }
        imgs = deeps.concat(imgs);
        return imgs.join('');
    }
function getTreeLineImgs(levels, treeNode, hasChildren, lastNodeLevels) {
        // this will be checked and src might be changed to img/tree-last.png if
        // this is the last item of a tree node.

        var imgs = [];

        // if this has children, we'll add a tree-parent line but should be
        // absolutely positioned right below the badge.
        if (hasChildren) imgs = [getTreeLine('parent', 'absolute')];

        if (treeNode === 'first') {
            // if first but level > 1, treat this as tree-node (not first).
            if (levels > 1) return getTreeLineImgs(levels, 'node', hasChildren);
        } else {
            // badge node
            imgs.unshift(getTreeLine(treeNode));
        }

        // deeper levels, if any...
        var deeps = [];
        if (levels > 2) {
            var i;
            for (i = 2; i < levels; i++) {
                // if parent symbol is the last in tree, we add space instead of
                // a deeper tree line.
                if (i <= lastNodeLevels) {
                    // add spaces to most-left with unshift
                    deeps.unshift(getTreeLine('space'));
                } else {
                    deeps.push(getTreeLine('deep'));
                }
            }
        }
        imgs = deeps.concat(imgs);
        return imgs.join('');
    }
Gets an array of image tags with tree-line images.
This is added in front of the symbol badge and name in the symbols menu.
@private

@param {Number} levels - Number of levels for the current node.
@param {String} treeNode - Kind of tree node. (i.e. 'first'/'parent',
'last' or 'node' (or 'deep' or 'space' which are calculated)).
@param {Boolean} hasChildren - Whether this node has child nodes. (has
its own branch).
@param {Number} lastNodeLevels - The number of levels that the latest node
that was "last" (└─*) in its own tree branch.

@returns {String} - HTML string.