From 78b4c3c820c7560b573c34e35c27862891b4848f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 6 Aug 2011 05:55:50 +0000 Subject: [PATCH] Fix source list glitch --- chrome/content/zotero/xpcom/collectionTreeView.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index 3c46c7ccfb..f44e438638 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -162,21 +162,22 @@ Zotero.CollectionTreeView.prototype.refresh = function() var header = { id: "group-libraries-header", label: "Group Libraries", // TODO: localize - expand: function (groups) { + expand: function (beforeRow, groups) { if (!groups) { var groups = Zotero.Groups.getAll(); } + var newRows = 0; for (var i = 0, len = groups.length; i < len; i++) { - var row = self._showRow(new Zotero.ItemGroup('group', groups[i]), 1); - self._expandRow(row); + var row = self._showRow(new Zotero.ItemGroup('group', groups[i]), 1, beforeRow ? beforeRow + i + newRows : null); + newRows += self._expandRow(row); } } } var row = this._showRow(new Zotero.ItemGroup('header', header)); if (this._containerState.HG) { this._dataItems[row][1] = true; - header.expand(groups); + header.expand(null, groups); } } @@ -547,7 +548,7 @@ Zotero.CollectionTreeView.prototype.toggleOpenState = function(row) var itemGroup = this._getItemAtRow(row); if (itemGroup.type == 'header') { - itemGroup.ref.expand(); + itemGroup.ref.expand(row + 1); } else if (itemGroup.isLibrary(true) || itemGroup.isCollection()) { this._expandRow(row, true);