From 63012a816fb6b601e42011bad4d84d56bcbe6a5d Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Wed, 1 May 2024 11:44:00 +0800 Subject: [PATCH] Fix library menu type attribute A follow up fix after #4052 Fix the padding of library menu on MacOS --- chrome/content/zotero/elements/zoteroSearch.js | 2 +- chrome/content/zotero/xpcom/utilities_internal.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/elements/zoteroSearch.js b/chrome/content/zotero/elements/zoteroSearch.js index 12bbc9f628..ebb9782895 100644 --- a/chrome/content/zotero/elements/zoteroSearch.js +++ b/chrome/content/zotero/elements/zoteroSearch.js @@ -554,10 +554,10 @@ for (let row of rows) { let menuitem = valueMenu.appendItem(row.name, row.value); + menuitem.setAttribute('type', 'radio'); if (row.image) { menuitem.className = 'menuitem-iconic'; menuitem.setAttribute('image', row.image); - menuitem.setAttribute('type', 'radio'); } } valueMenu.selectedIndex = 0; diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 099bec6d62..5356821b29 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -1548,6 +1548,7 @@ Zotero.Utilities.Internal = { let menuitem = menulist.ownerDocument.createXULElement('menuitem'); menuitem.value = library.libraryID; menuitem.setAttribute('label', library.name); + menuitem.setAttribute('type', 'radio'); menuitem.setAttribute('data-editable', library.editable ? 'true' : 'false'); menuitem.setAttribute('data-filesEditable', library.filesEditable ? 'true' : 'false'); menupopup.appendChild(menuitem);