diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index c837b93fa..3b100a000 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -302,7 +302,8 @@ var ZoteroOverlay = new function() */ this.toggleTab = function(setMode) { var tab = this.findZoteroTab(); - window.zoteroSavedSelection = ZoteroPane.itemsView.saveSelection(); + window.zoteroSavedItemSelection = ZoteroPane.itemsView.saveSelection(); + window.zoteroSavedCollectionSelection = ZoteroPane.collectionsView.saveSelection(); if(tab) { // Zotero is running in a tab if(setMode) return; // don't do anything if Zotero tab is the only tab diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 19287182c..315c596f5 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -347,21 +347,28 @@ var ZoteroPane = new function() return false; } - this.unserializePersist(); + this.updateTagSelectorSize(); + // restore saved row selection (for tab switching) var containerWindow = (window.ZoteroTab ? window.ZoteroTab.containerWindow : window); - if(containerWindow.zoteroSavedSelection) { + if(containerWindow.zoteroSavedCollectionSelection) { + this.collectionsView.rememberSelection(containerWindow.zoteroSavedCollectionSelection); + delete containerWindow.zoteroSavedCollectionSelection; + } + + // restore saved item selection (for tab switching) + if(containerWindow.zoteroSavedItemSelection) { var me = this; // hack to restore saved selection after itemTreeView finishes loading window.setTimeout(function() { - if(containerWindow.zoteroSavedSelection) { - me.itemsView.rememberSelection(containerWindow.zoteroSavedSelection) - delete containerWindow.zoteroSavedSelection; + if(containerWindow.zoteroSavedItemSelection) { + me.itemsView.rememberSelection(containerWindow.zoteroSavedItemSelection); + delete containerWindow.zoteroSavedItemSelection; } }, 51); } - this.updateTagSelectorSize(); + this.unserializePersist(); // Focus the quicksearch on pane open setTimeout("document.getElementById('zotero-tb-search').inputField.select();", 1);