Fixed node insert bug

This commit is contained in:
Gonzalo Bellver 2012-02-06 11:12:27 -03:00
parent 1b9a20adad
commit bf212e649a

View File

@ -102,6 +102,12 @@ mindplot.layout.BalancedSorter = new Class({
insert: function(treeSet, parent, child, order) {
var children = this._getChildrenForOrder(parent, treeSet, order);
// If no children, return 0 or 1 depending on the side
if (children.length == 0) {
child.setOrder(order % 2);
return;
}
// Shift all the elements by two, so side is the same.
// In case of balanced sorter, order don't need to be continuous...
var max = 0;