fx115: lookup panel fixes

- do not resize based on scrollable content - it shrinks the panel
- add padding into the stylesheet
- remove onShowing, since it doesn't seem needed anymore
This commit is contained in:
Bogdan Abaev 2024-02-01 10:30:46 -05:00 committed by Dan Stillman
parent 48858fe07f
commit 2d3bc12ca0
3 changed files with 2 additions and 26 deletions

View file

@ -184,24 +184,6 @@ var Zotero_Lookup = new function () {
}
/**
* Focuses the field
*/
this.onShowing = function (event) {
// Ignore context menu
if (event.originalTarget.id != 'zotero-lookup-panel') return;
document.getElementById("zotero-lookup-panel").style.padding = "10px";
// Resize arrow box to fit content
if (Zotero.isMac) {
let panel = document.getElementById("zotero-lookup-panel");
let box = panel.firstChild;
panel.sizeTo(box.scrollWidth, box.scrollHeight);
}
}
/**
* Focuses the field
*/
@ -280,13 +262,6 @@ var Zotero_Lookup = new function () {
mlTxtBox.rows = on ? 5 : 1;
mlButtons.hidden = !on;
// Resize arrow box to fit content -- also done in onShowing()
if(Zotero.isMac) {
var panel = document.getElementById("zotero-lookup-panel");
var box = panel.firstChild;
panel.sizeTo(box.scrollWidth, box.scrollHeight);
}
return mlTxtBox;
};

View file

@ -1087,7 +1087,6 @@
/>
<panel id="zotero-lookup-panel" type="arrow"
onpopupshowing="Zotero_Lookup.onShowing(event)"
onpopupshown="Zotero_Lookup.onShown(event)"
onpopuphidden="Zotero_Lookup.onHidden(event)"
onfocusout="Zotero_Lookup.onFocusOut(event)"

View file

@ -278,11 +278,13 @@ TODO: Replace with SVG
margin: 4px;
padding: 2px;
-moz-box-flex: 1;
overflow-x: hidden; /* Fixes a glitch that renders an extra row */
}
#zotero-lookup-panel {
min-height: 100px;
min-width: 500px;
padding: 10px;
}
#zotero-lookup-multiline-progress