Skip to content

Commit

Permalink
zomg a slash
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpardee committed May 16, 2012
1 parent 322d278 commit 45a30e2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions plugins-client/ext.tree/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,31 +158,24 @@ module.exports = ext.register("ext/tree/tree", {
else
lut[path] = true;
}

console.log("These are the paths we're checking", lut);

// This checks that each expanded folder has a root that's already
// been saved
var rootPrefixNodes = ide.davPrefix.split("/").length - 2;
console.log("Length root prefix nodes", rootPrefixNodes);
var rootPrefixNodes = ide.davPrefix.split("/").length - 1;
var cc, parts;
for (path in lut) {
console.log("Checking that path has a parent", path);
parts = path.split("/").splice(rootPrefixNodes);
cc = parts.shift();
do {
cc = "/" + parts.shift();
while(lut[cc]) {
if (!parts.length)
break;

cc += "/" + parts.shift();
} while(lut[cc]);
}

if (!parts.length)
_self.expandedNodes.push(path);
else
console.log("Couldn't find it!", parts.length, path);
}

console.log("And this is what we got!", _self.expandedNodes);

expandedNodes.nodeValue = JSON.stringify(_self.expandedNodes);
Expand Down

0 comments on commit 45a30e2

Please sign in to comment.