commit e35575e6fd36bc9f9306a10b7db36caf1d831856
parent 2ed04eca26fe5c63289f1bd6333d1f377b3aa1fe
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 24 May 2015 19:58:54 -0400
If last viewed collection is set but not found, default to My Library
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -108,9 +108,9 @@ Zotero.CollectionTreeView.prototype.setTree = Zotero.Promise.coroutine(function*
var lastViewedID = Zotero.Prefs.get('lastViewedFolder');
if (lastViewedID) {
- yield this.selectByID(lastViewedID);
+ var selected = yield this.selectByID(lastViewedID);
}
- else {
+ if (!selected) {
this.selection.select(0);
}
@@ -849,7 +849,7 @@ Zotero.CollectionTreeView.prototype.selectByID = Zotero.Promise.coroutine(functi
switch (type) {
case 'L':
yield this.selectLibrary(id);
- return;
+ return true;
case 'C':
var found = yield this.expandToCollection(id);
@@ -862,11 +862,13 @@ Zotero.CollectionTreeView.prototype.selectByID = Zotero.Promise.coroutine(functi
}
if (!found) {
- return;
+ return false;
}
var row = this._rowMap[type + id];
this._treebox.ensureRowIsVisible(row);
yield this.selectWait(row);
+
+ return true;
});