diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js index 3a4264f689..a7723e998b 100644 --- a/chrome/content/zotero/standalone/standalone.js +++ b/chrome/content/zotero/standalone/standalone.js @@ -240,16 +240,6 @@ const ZoteroStandalone = new function () { this.onUpdateCustomMenus(event, 'edit'); }; - - this.showNoteInLibrary = function () { - let win = Zotero.getMainWindow(); - let noteEditor = Zotero.Notes.getByTabID(Zotero_Tabs.selectedID); - if (!noteEditor?.itemID) { - return; - } - win.ZoteroPane.selectItems([noteEditor.itemID]); - win.focus(); - }; /** * Builds new item menu diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 627b70dcc1..92eb645733 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -5397,6 +5397,30 @@ var ZoteroPane = new function () { } + this.showInLibrary = function () { + switch (Zotero_Tabs.selectedType) { + case 'reader': { + let reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID); + if (reader) { + let item = Zotero.Items.get(reader.itemID); + let itemID = item.parentID || item.id; + return ZoteroPane.selectItems([itemID]); + } + return; + } + case 'note': { + let tab = Zotero_Tabs.getTabInfo(Zotero_Tabs.selectedID); + if (tab.data.itemID) { + return ZoteroPane.selectItems([tab.data.itemID]); + } + return; + } + default: + return; + } + }; + + function viewSelectedAttachment(event, noLocateOnMissing) { if (this.itemsView && this.itemsView.selection.count == 1) { diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 291d3fdaf2..62de1383fd 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -324,8 +324,7 @@ oncommand="ZoteroStandalone.currentReader.export()"/> - - +