Closes #653, Remember last-accessed collection

Because of the way item caching works, this doesn't fix most of the startup delay problems, though
This commit is contained in:
Dan Stillman 2007-07-25 20:33:35 +00:00
parent 667c1e4743
commit 08da46cab3
3 changed files with 16 additions and 2 deletions

View File

@ -69,8 +69,19 @@ Zotero.CollectionTreeView.prototype.setTree = function(treebox)
this.refresh();
//select Library
this.selection.select(0);
// Select the last-viewed collection
var lastViewedFolder = Zotero.Prefs.get('lastViewedFolder');
var matches = lastViewedFolder.match(/^(?:(C|S)([0-9]+)|L)$/);
var select = 0;
if (matches) {
if (matches[1] == 'C' && this._collectionRowMap[matches[2]]) {
select = this._collectionRowMap[matches[2]];
}
else if (matches[1] == 'S' && this._searchRowMap[matches[2]]) {
select = this._searchRowMap[matches[2]];
}
}
this.selection.select(select);
}
/*

View File

@ -2564,6 +2564,8 @@ Zotero.Items = new function(){
function cacheFields(fields, items) {
Zotero.debug("Caching fields [" + fields.join() + "]"
+ (items ? " for " + items + " items" : ''));
_load(items);
var primaryFields = [];

View File

@ -24,6 +24,7 @@ pref("extensions.zotero.capitalizeTitles", true);
pref("extensions.zotero.lastCreatorFieldMode",0);
pref("extensions.zotero.lastAbstractExpand",0);
pref("extensions.zotero.lastRenameAssociatedFile", false);
pref("extensions.zotero.lastViewedFolder", 'L');
// Keyboard shortcuts
pref("extensions.zotero.keys.overrideGlobal", false);