Always select new items, disable File -> New Item appropriately

Fixes #2405. This also fixes an issue where Cmd/Ctrl-Shift-N in a
collection like Duplicate Items would open the item type menu on top of
a blank white item pane (since the new item didn't get selected first).
This commit is contained in:
Abe Jellinek 2022-03-11 13:39:26 -08:00
parent c9ccd758bc
commit 52bc93adc9

View file

@ -899,6 +899,9 @@ var ZoteroPane = new function()
//set to Info tab //set to Info tab
document.getElementById('zotero-view-item').selectedIndex = 0; document.getElementById('zotero-view-item').selectedIndex = 0;
// Ensure item is visible
yield this.selectItem(itemID);
if (manual) { if (manual) {
// Update most-recently-used list for New Item menu // Update most-recently-used list for New Item menu
this.addItemTypeToNewItemTypeMRU(Zotero.ItemTypes.getName(typeID)); this.addItemTypeToNewItemTypeMRU(Zotero.ItemTypes.getName(typeID));
@ -1262,6 +1265,7 @@ var ZoteroPane = new function()
"cmd_zotero_newCollection", "cmd_zotero_newCollection",
"cmd_zotero_newSavedSearch", "cmd_zotero_newSavedSearch",
"zotero-tb-add", "zotero-tb-add",
"menu_newItem",
"zotero-tb-lookup", "zotero-tb-lookup",
"cmd_zotero_newStandaloneNote", "cmd_zotero_newStandaloneNote",
"zotero-tb-note-add", "zotero-tb-note-add",