From 8bcf1d446aa5f9193a7ee29162862b05945ec8e1 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Thu, 1 Feb 2024 04:27:32 -0500 Subject: [PATCH] url/doi/options icon does not occupy space unless hovered (#3631) url/doi/options do not occupy space unless the row is focused or hovered. This does not apply to options icons after multiline fields because it would shrink textarea on hover and shift text in an awkward way. Fixes: #3612 --- chrome/content/zotero/elements/itemBox.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/elements/itemBox.js b/chrome/content/zotero/elements/itemBox.js index 8cc661c249..430d7f4b6b 100644 --- a/chrome/content/zotero/elements/itemBox.js +++ b/chrome/content/zotero/elements/itemBox.js @@ -639,6 +639,11 @@ || Zotero.ItemFields.isFieldOfBase(fieldID, 'publicationTitle'))) { let optionsButton = document.createXULElement("toolbarbutton"); optionsButton.className = "zotero-clicky zotero-clicky-options show-on-hover"; + // Options button after single-line fields will not occupy space unless hovered. + // This does not apply to multiline fields because it would move textarea on hover. + if (!(Zotero.ItemFields.isLong(fieldName) || Zotero.ItemFields.isMultiline(fieldName))) { + optionsButton.classList.add("no-display"); + } optionsButton.setAttribute("ztabindex", ++this._ztabindex); optionsButton.setAttribute('data-l10n-id', "itembox-button-options"); // eslint-disable-next-line no-loop-func @@ -1450,7 +1455,7 @@ return null; } let openLink = document.createXULElement("toolbarbutton"); - openLink.className = "zotero-clicky zotero-clicky-open-link show-on-hover"; + openLink.className = "zotero-clicky zotero-clicky-open-link show-on-hover no-display"; openLink.addEventListener("click", event => ZoteroPane.loadURI(value, event)); openLink.addEventListener('keypress', event => this.handleKeyPress(event)); openLink.setAttribute("ztabindex", ++this._ztabindex);