www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit a5eb5a5af5c8047b66c1afd52a2406b4e1d0dda4
parent b2f0d3beb06e4dc497039dfbe4bd2ec040d1f151
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 24 Sep 2015 06:46:02 -0400

Scroll collection into view on collection-containing-an-item

Diffstat:
Mchrome/content/zotero/xpcom/collectionTreeView.js | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -384,10 +384,17 @@ Zotero.CollectionTreeView.prototype.setHighlightedRows = function (ids) { this._highlightedRows = {}; this._treebox.invalidate(); + var scrolled = false; for each(var id in ids) { + let row = this._collectionRowMap[id]; this.expandToCollection(id); - this._highlightedRows[this._collectionRowMap[id]] = true; - this._treebox.invalidateRow(this._collectionRowMap[id]); + // TODO: Scroll a little above or below + if (!scrolled) { + this._treebox.ensureRowIsVisible(row); + scrolled = true; + } + this._highlightedRows[row] = true; + this._treebox.invalidateRow(row); } }