app/js/tree_logic.js
// Scrolls to a node in the file tree of the current workspace
Scrolls to a node in the file tree of the current workspace
Scrolls to a node in the file tree of the current workspace
function scrollToNodeInTree(node) {
    let parent = node.parent
    while (parent) {
        $(`#${currentWorkspace}_tree`).tree('openNode', parent);
        parent = parent.parent
    }
    $(`#${currentWorkspace}_tree`).tree('scrollToNode', node);
    $(`#${currentWorkspace}_tree`).tree('addToSelection', node);
    document.addEventListener('click', tempDeselectNode, true);
    function tempDeselectNode() {
        console.log("temp deselect called");
        let nodeTemp = $(`#${currentWorkspace}_tree`).tree('getNodeById', node.id);
        $(`#${currentWorkspace}_tree`).tree('removeFromSelection', nodeTemp);
        document.removeEventListener('click', tempDeselectNode, true);
    }
}
function scrollToNodeInTree ( node ) { let parent = node . parent while ( parent ) { $ ( ` ${ currentWorkspace } ` ) . tree ( 'openNode' , parent ) ; parent = parent . parent } $ ( ` ${ currentWorkspace } ` ) . tree ( 'scrollToNode' , node ) ; $ ( ` ${ currentWorkspace } ` ) . tree ( 'addToSelection' , node ) ; document . addEventListener ( 'click' , tempDeselectNode , true ) ; function tempDeselectNode ( ) { console . log ( "temp deselect called" ) ; let nodeTemp = $ ( ` ${ currentWorkspace } ` ) . tree ( 'getNodeById' , node . id ) ; $ ( ` ${ currentWorkspace } ` ) . tree ( 'removeFromSelection' , nodeTemp ) ; document . removeEventListener ( 'click' , tempDeselectNode , true ) ; } }
Scrolls to a node in the file tree of the current workspace
Scrolls to a node in the file tree of the current workspace
// Open up all parent folders if a node is nested // Scroll to node // Highlight the node // Unselects node onclick