Debug code for library selection issues

This commit is contained in:
Simon Kornblith 2011-03-22 02:24:58 +00:00
parent 135c47944d
commit 7aea4fabf9

View File

@ -1737,15 +1737,18 @@ var ZoteroPane = new function()
var currentLibraryID = this.getSelectedLibraryID();
// If in a different library
if (item.libraryID != currentLibraryID) {
Zotero.debug("Library ID differs; switching library");
this.collectionsView.selectLibrary(item.libraryID);
}
// Force switch to library view
else if (!this.itemsView._itemGroup.isLibrary() && inLibrary) {
Zotero.debug("Told to select in library; switching to library");
this.collectionsView.selectLibrary(item.libraryID);
}
var selected = this.itemsView.selectItem(itemID, expand);
if (!selected) {
Zotero.debug("Item was not selected; switching to library");
this.collectionsView.selectLibrary(item.libraryID);
this.itemsView.selectItem(itemID, expand);
}