Bug 412988 - "Wrong viewIndex after lazy changes of title" (Fix order when title gets updated) [p=ondrej@allpeers.com (Ondrej Brablc) r=dietrich a1.9=schrep]

This commit is contained in:
reed@reedloden.com 2008-01-25 00:03:28 -08:00
parent 4ea6b0e4b6
commit 544c75a37a

View File

@ -592,10 +592,11 @@ PlacesTreeView.prototype = {
// At the end of the child list without finding a visible sibling: This
// is a little harder because we don't know how many rows the last item
// in our list takes up (it could be a container with many children).
var lastRowCount =
this._countVisibleRowsForItem(aParent.getChild(aNewIndex - 1));
newViewIndex =
aParent.getChild(aNewIndex - 1).viewIndex + lastRowCount;
var prevChild = aParent.getChild(aNewIndex - 1);
newViewIndex = prevChild.viewIndex + this._countVisibleRowsForItem(prevChild);
// If we were in the same parent and we are swapping the order, we need to adjust
if (prevChild.parent == aItem.parent && prevChild.viewIndex > aItem.viewIndex)
newViewIndex--;
}
}