Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9102abf

Browse filesBrowse files
committed
handling root path properly
1 parent f12a079 commit 9102abf
Copy full SHA for 9102abf

File tree

Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed

‎index.html

Copy file name to clipboardExpand all lines: index.html
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@
9898
if(!parts || parts.length == 0) {
9999
return callback(current);
100100
}
101-
if(!parts[0]) {
102-
current = root;
103-
} else if(parts[0] == ".") {
101+
if(parts[0] == ".") {
104102
// carry on
105103
} else if(parts[0] == "..") {
106104
current = current.parent;
@@ -132,8 +130,9 @@
132130
return callback(pathhandler.current);
133131
}
134132
var parts = _.filter(path.split('/'), function(x) { return x; });
135-
console.log(JSON.stringify(parts));
136-
return findNode(pathhandler.current, parts, callback);
133+
var start = ((path || '')[0] == '/') ? root :
134+
console.log('start: '+start.path+', parts: '+JSON.stringify(parts));
135+
return findNode(start, parts, callback);
137136
};
138137
pathhandler.getChildNodes = function(node, callback) {
139138
console.log("children for "+node.name);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.