onChangePath(p, callback) {
        let foundPath   = this.findLoadedPath(p);
        let directory   = this.findDirectoryItemFromPath(foundPath);
        let nodeToGet   = [foundPath];
        let filesInPath = [];
        let forEachKey  = function(object, callback) {
                for (let key in object) {
                    callback(key);
                }
            };
        let addNewItem = function(array, item) {
                if (array.indexOf(item) === -1) {
                    array.push(item);
                }
            };
        forEachKey(this._fullPathOpen, addNewItem.bind(nodeToGet, nodeToGet));
        // Add all files found in directory...
        let pathListCallback = (parentNode, p, fileList) => {
                if ((p === foundPath) || this._fullPathLoaded[p]) {
                    filesInPath.push({path: p, fileList: fileList, toString: function() { return this.path; }});
                    fileList.forEach(
                        function(file) {
                            if (file.directory && (file.name !== '..')) {
                                let s = path.join(p, file.name);
                                if (this._fullPathLoaded[s]) {
                                    addNewItem(nodeToGet, s);
                                }
                            }
                        },
                        this
                    );
                }
                getNode(); // Next directory...
            };
        // Load all files in directory...
        let nodeIndex = 0;
        let getNode   = () => {
                if (nodeIndex < nodeToGet.length) {
                    this.getFiles(null, nodeToGet[nodeIndex], pathListCallback);
                    nodeIndex++;
                } else {
                    if (directory) {
                        directory.clear();
                        this.showFilesInPath(filesInPath);
                    }
                    callback();
                }
            };
        getNode();
    }
/**
     * Update all files and open directories in the given path...
    **/
Update all files and open directories in the given path
Update all files and open directories in the given path
onChangePath(p, callback) {
        let foundPath   = this.findLoadedPath(p);
        let directory   = this.findDirectoryItemFromPath(foundPath);
        let nodeToGet   = [foundPath];
        let filesInPath = [];
        let forEachKey  = function(object, callback) {
                for (let key in object) {
                    callback(key);
                }
            };
        let addNewItem = function(array, item) {
                if (array.indexOf(item) === -1) {
                    array.push(item);
                }
            };
        forEachKey(this._fullPathOpen, addNewItem.bind(nodeToGet, nodeToGet));
        let pathListCallback = (parentNode, p, fileList) => {
                if ((p === foundPath) || this._fullPathLoaded[p]) {
                    filesInPath.push({path: p, fileList: fileList, toString: function() { return this.path; }});
                    fileList.forEach(
                        function(file) {
                            if (file.directory && (file.name !== '..')) {
                                let s = path.join(p, file.name);
                                if (this._fullPathLoaded[s]) {
                                    addNewItem(nodeToGet, s);
                                }
                            }
                        },
                        this
                    );
                }
                getNode(); 
            };
        let nodeIndex = 0;
        let getNode   = () => {
                if (nodeIndex < nodeToGet.length) {
                    this.getFiles(null, nodeToGet[nodeIndex], pathListCallback);
                    nodeIndex++;
                } else {
                    if (directory) {
                        directory.clear();
                        this.showFilesInPath(filesInPath);
                    }
                    callback();
                }
            };
        getNode();
    }
onChangePath ( p , callback ) { let foundPath = this . findLoadedPath ( p ) ; let directory = this . findDirectoryItemFromPath ( foundPath ) ; let nodeToGet = [ foundPath ] ; let filesInPath = [ ] ; let forEachKey = function ( object , callback ) { for ( let key in object ) { callback ( key ) ; } } ; let addNewItem = function ( array , item ) { if ( array . indexOf ( item ) === - 1 ) { array . push ( item ) ; } } ; forEachKey ( this . _fullPathOpen , addNewItem . bind ( nodeToGet , nodeToGet ) ) ; let pathListCallback = ( parentNode , p , fileList ) => { if ( ( p === foundPath ) || this . _fullPathLoaded [ p ] ) { filesInPath . push ( { path : p , fileList : fileList , toString : function ( ) { return this . path ; } } ) ; fileList . forEach ( function ( file ) { if ( file . directory && ( file . name !== '..' ) ) { let s = path . join ( p , file . name ) ; if ( this . _fullPathLoaded [ s ] ) { addNewItem ( nodeToGet , s ) ; } } } , this ) ; } getNode ( ) ; } ; let nodeIndex = 0 ; let getNode = ( ) => { if ( nodeIndex < nodeToGet . length ) { this . getFiles ( null , nodeToGet [ nodeIndex ] , pathListCallback ) ; nodeIndex ++ ; } else { if ( directory ) { directory . clear ( ) ; this . showFilesInPath ( filesInPath ) ; } callback ( ) ; } } ; getNode ( ) ; }
Update all files and open directories in the given path...
Update all files and open directories in the given path ...
// Add all files found in directory... // Next directory... // Load all files in directory...