From 5bf460771ce38210762fc29eb863d55fecb55ccc Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Thu, 8 May 2025 22:49:21 +0200 Subject: [PATCH] Improve attachment row annotation button click behavior fix: #5249 --- chrome/content/zotero/elements/attachmentRow.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/chrome/content/zotero/elements/attachmentRow.js b/chrome/content/zotero/elements/attachmentRow.js index 72fc1f705b..8f128f208e 100644 --- a/chrome/content/zotero/elements/attachmentRow.js +++ b/chrome/content/zotero/elements/attachmentRow.js @@ -107,20 +107,8 @@ import { getCSSItemTypeIcon } from 'components/icons'; }; _handleAnnotationClick = () => { - // TODO: jump to annotations pane - let pane; - if (ZoteroContextPane) { - pane = ZoteroContextPane.sidenav?.container.querySelector(`:scope > [data-pane="attachment-annotations"]`); - } - if (pane) { - pane._section.open = true; - } - let win = Zotero.getMainWindow(); - if (win) { - win.ZoteroPane.selectItem(this._attachment.id); - win.Zotero_Tabs.select('zotero-pane'); - win.focus(); - } + Zotero_Tabs.select('zotero-pane'); + ZoteroPane.selectItems(this._attachment.getAnnotations().map(a => a.id)); }; _handleRemove = async () => {