Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
fixed #nextNode
Browse files Browse the repository at this point in the history
  • Loading branch information
brighthas committed Oct 31, 2013
1 parent 16136ae commit f5a7c69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Expand Up @@ -244,13 +244,15 @@ o.down = function (childId) {
o.nextNode = function (childId) {
var child = this._getNode(childId);
if (child) {
var parent = child.parent,
index = child.position(),
var parent = child.parent;
if(parent){
var index = child.position(),
nextChildId = parent._childIdsList[index + 1];

if (nextChildId) {
return parent.getChild(nextChildId);
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "tree-node",
"version": "0.0.4",
"version": "0.0.5",
"description": "tree node",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f5a7c69

Please sign in to comment.