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

Commit

Permalink
fixed #top
Browse files Browse the repository at this point in the history
  • Loading branch information
brighthas committed May 5, 2014
1 parent 7cbeb4b commit 81e50e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -201,9 +201,9 @@ o.top = function (childId) {
var child = this._getNode(childId),
parent;
if (child && (parent = child.parent)) {
var index = parent._childIdsList.indexOf(childId);
var index = parent._childIdsList.indexOf(child.id);
parent._childIdsList.splice(index, 1);
parent._childIdsList.unshift(childId);
parent._childIdsList.unshift(child.id);

parent.emit("child list changed",parent,parent._childIdsList.concat());
var root = this.root;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "tree-node",
"version": "0.1.5",
"version": "0.1.6",
"description": "tree node",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 81e50e6

Please sign in to comment.