commit 10111dbd98c140620b9fb97d40895f0d0e74149a
parent 48a81e3b4606b26232f5d8312688c150529cb796
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 29 Jan 2017 09:18:16 -0500
Ensure modified item stays visible
There seems to be a bug here where, if the item is off-screen when
modified, it doesn't become visible, but it now does stay visible when
it's on-screen to begin with.
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js
@@ -1674,12 +1674,6 @@ Zotero.ItemTreeView.prototype.selectItem = Zotero.Promise.coroutine(function* (i
return false;
}
- var selected = this.getSelectedItems(true);
- if (selected.length == 1 && selected[0] == id) {
- Zotero.debug("Item " + id + " is already selected");
- return true;
- }
-
var row = this._rowMap[id];
// Get the row of the parent, if there is one
@@ -1696,6 +1690,13 @@ Zotero.ItemTreeView.prototype.selectItem = Zotero.Promise.coroutine(function* (i
parentRow = this._rowMap[parent];
}
+ var selected = this.getSelectedItems(true);
+ if (selected.length == 1 && selected[0] == id) {
+ Zotero.debug("Item " + id + " is already selected");
+ this.betterEnsureRowIsVisible(row, parentRow);
+ return true;
+ }
+
// If row with id not visible, check to see if it's hidden under a parent
if(row == undefined)
{