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
This commit is contained in:
abaevbog 2024-02-01 04:27:32 -05:00 committed by GitHub
parent 0985362829
commit 8bcf1d446a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);