diff --git a/chrome/content/zotero/elements/itemBox.js b/chrome/content/zotero/elements/itemBox.js index ca3906fe72..65a10852f5 100644 --- a/chrome/content/zotero/elements/itemBox.js +++ b/chrome/content/zotero/elements/itemBox.js @@ -752,26 +752,28 @@ } addItemTypeMenu() { + var td = document.createElement('td'); var menulist = document.createXULElement("menulist", { is: "menulist-item-types" }); menulist.id = "item-type-menu"; menulist.className = "zotero-clicky"; - menulist.onCommand = (event) => { + menulist.addEventListener('command', (event) => { var target = event.target; this.changeTypeTo(target.value, target); - }; - menulist.onFocus = (event) => { + }); + menulist.addEventListener('focus', () => { this.ensureElementIsVisible(menulist); - }; - menulist.onKeyPress = (event) => { + }); + menulist.addEventListener('keypress', (event) => { if (event.keyCode == event.DOM_VK_TAB) { this.itemTypeMenuTab(event); } - }; - this._infoTable.firstChild.appendChild(menulist); + }); + td.appendChild(menulist); + this._infoTable.firstChild.appendChild(td); } updateItemTypeMenuSelection() { - this.itemTypeMenu.value = this.item.itemType; + this.itemTypeMenu.value = this.item.itemTypeID; } addDynamicRow(label, value, beforeElement) { diff --git a/chrome/content/zotero/elements/menulistItemTypes.js b/chrome/content/zotero/elements/menulistItemTypes.js index d3f62a3b29..c6fd88bff0 100644 --- a/chrome/content/zotero/elements/menulistItemTypes.js +++ b/chrome/content/zotero/elements/menulistItemTypes.js @@ -54,7 +54,7 @@ var itemTypes = []; for (let i = 0; i < t.length; i++) { itemTypes.push({ - name: t[i].name, + id: t[i].id, localized: Zotero.ItemTypes.getLocalizedString(t[i].id) }); } @@ -64,7 +64,7 @@ for (let i = 0; i < itemTypes.length; i++) { let name = itemTypes[i].name; if (name != 'attachment' && name != 'note' && name != 'annotation') { - this.appendItem(itemTypes[i].localized, itemTypes[i].name); + this.appendItem(itemTypes[i].localized, itemTypes[i].id); } }