diff --git a/js/project/node.js b/js/project/node.js index 7960bcf..a12225d 100644 --- a/js/project/node.js +++ b/js/project/node.js @@ -100,6 +100,7 @@ define([ }, done) }, readdir: function(done) { + if (!this.isDir) return done(); //TODO: track entries, compare to existing, do not duplicate var self = this; var reader = this.entry.createReader(); diff --git a/js/project/tree.js b/js/project/tree.js index 9a3c16d..a6249b1 100644 --- a/js/project/tree.js +++ b/js/project/tree.js @@ -36,10 +36,10 @@ define([ //after initial render, do the walk for path lookup root.walk(function(node, c) { pathMap[node.entry.fullPath] = node; - //make sure the children are read and populated - node.readdir(function() { - c(); - }); + //make sure the children are read and populated, then continue + if (node.isDir) { + node.readdir(c); + } else c(); }); }); setVisible();