From 578986ab1ee0281c5ca1e73107ea251947ffb99e Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 19 Apr 2022 23:02:55 -0400 Subject: [PATCH] Fix item types not appearing in New Item submenu https://forums.zotero.org/discussion/96530/a-issue-about-new-item-drop-down-menu After a type from the submenu was selected and added to the MRU, the submenu wouldn't be updated. Not sure how long this has been going on. Fixes #2534 --- chrome/content/zotero/xpcom/schema.js | 1 - chrome/content/zotero/zoteroPane.js | 94 +++++++++++++-------------- 2 files changed, 45 insertions(+), 50 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 95aba2946a..703bec1e45 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -851,7 +851,6 @@ Zotero.Schema = new function(){ var enumerator = Services.wm.getEnumerator("navigator:browser"); while (enumerator.hasMoreElements()) { let win = enumerator.getNext(); - win.ZoteroPane.buildItemTypeSubMenu(); win.document.getElementById('zotero-editpane-item-box').buildItemTypeMenu(); } }); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 38cf08b5a6..3088a5547b 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -271,43 +271,14 @@ var ZoteroPane = new function() }; - /* - * Create the New Item (+) submenu with each item type - */ - this.buildItemTypeSubMenu = function () { - var moreMenu = document.getElementById('zotero-tb-add-more'); - - while (moreMenu.hasChildNodes()) { - moreMenu.removeChild(moreMenu.firstChild); - } - - // Sort by localized name - var t = Zotero.ItemTypes.getSecondaryTypes(); - var itemTypes = []; - for (var i=0; i