From 1427e3e324f983c40ae0dc52d34310cd795d3515 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 13 Jan 2024 06:49:17 -0500 Subject: [PATCH] Open item pane if closed on New Item --- chrome/content/zotero/zoteroPane.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 16b49ab47a..9d8f9aea1d 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1319,6 +1319,12 @@ var ZoteroPane = new function() } }); + // Expand the item pane if it's closed + var itemPane = document.getElementById("zotero-item-pane"); + if (itemPane.getAttribute("collapsed") == "true") { + itemPane.setAttribute("collapsed", false) + } + //set to Info tab document.getElementById('zotero-view-item').selectedIndex = 0; @@ -1328,11 +1334,8 @@ var ZoteroPane = new function() if (manual) { // Update most-recently-used list for New Item menu this.addItemTypeToNewItemTypeMRU(Zotero.ItemTypes.getName(typeID)); - // Focus the title field if the itemPane is expanded - let itemPane = document.getElementById("zotero-item-pane"); - if (!itemPane.getAttribute("collapsed")) { - document.getElementById('zotero-item-pane-header').querySelector("editable-text").focus(); - } + // Focus the title field + document.getElementById('zotero-item-pane-header').querySelector("editable-text").focus(); } return Zotero.Items.getAsync(itemID);