app/js/tree_logic.js
// Creates folder on given node (root if null)
Creates folder on given node (root if null)
Creates folder on given node ( root if null )
function createFolder(node, folderName) {
    let newFolder = {
        name: folderName,
        type: 'folder',
        id: uuid4()
    };
    let $tree = $('#' + currentWorkspace + '_tree');
    if (node) {
        $tree.tree(
            'appendNode',
            newFolder,
            node
        );
    }
    else {
        if ($tree.tree('getTree')) {
            $tree.tree(
                'appendNode',
                newFolder,
            );
        }
        else {
            makeTree(currentWorkspace, [newFolder]);
        }
    }
    treeToJson(currentWorkspace);
    treeToBackupJson(currentWorkspace);
    addTreeTooltips(currentWorkspace);
}
function createFolder ( node , folderName ) { let newFolder = { name : folderName , type : 'folder' , id : uuid4 ( ) } ; let $tree = $ ( '#' + currentWorkspace + '_tree' ) ; if ( node ) { $tree . tree ( 'appendNode' , newFolder , node ) ; } else { if ( $tree . tree ( 'getTree' ) ) { $tree . tree ( 'appendNode' , newFolder , ) ; } else { makeTree ( currentWorkspace , [ newFolder ] ) ; } } treeToJson ( currentWorkspace ) ; treeToBackupJson ( currentWorkspace ) ; addTreeTooltips ( currentWorkspace ) ; }
Creates folder on given node (root if null)
Creates folder on given node ( root if null )
// If parent node // If root // Write tree data to tree json file in the workspace repo // Adds tooltip logic to tree (when adding a folder node in this case)