Skip to content

Commit

Permalink
Fix wrong attach operation when a node is moved as root
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriogalano committed Aug 14, 2012
1 parent 59d62fb commit 8619ca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/jquery.tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $.widget("daredevel.tree", {
if (position == 0) {
position = position + 1;
}
ul.find('li:nth-child(' + position + '):first').before(li);
ul.children('li:nth-child('+position+')').before(li);
}
} else {
ul = $('<ul/>');
Expand Down Expand Up @@ -259,7 +259,7 @@ $.widget("daredevel.tree", {

var parents = li.parentsUntil('.' + this.widgetBaseClass);

return 0 == parents.length;
return 1 == parents.length;
},

/**
Expand Down

0 comments on commit 8619ca6

Please sign in to comment.