A true platform-general solution to the panel sizing problem
This commit is contained in:
parent
6750535319
commit
bbd686f8bb
|
@ -24,6 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Zotero_QuickFormat = new function () {
|
var Zotero_QuickFormat = new function () {
|
||||||
|
const pixelRe = /^([0-9]+)px$/
|
||||||
var initialized, io, qfs, qfi, qfiWindow, qfiDocument, qfe, qfb, qfbHeight, keepSorted,
|
var initialized, io, qfs, qfi, qfiWindow, qfiDocument, qfe, qfb, qfbHeight, keepSorted,
|
||||||
showEditor, referencePanel, referenceBox, referenceHeight = 0, separatorHeight = 0,
|
showEditor, referencePanel, referenceBox, referenceHeight = 0, separatorHeight = 0,
|
||||||
currentLocator, currentLocatorLabel, currentSearchTime, dragging, panel,
|
currentLocator, currentLocatorLabel, currentSearchTime, dragging, panel,
|
||||||
|
@ -741,15 +742,19 @@ var Zotero_QuickFormat = new function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!panelFrameHeight) {
|
if(!panelFrameHeight) {
|
||||||
if(Zotero.isWin || Zotero.isMac) {
|
panelFrameHeight = referencePanel.boxObject.height - referencePanel.clientHeight;
|
||||||
panelFrameHeight = 1;
|
var computedStyle = window.getComputedStyle(referenceBox, null);
|
||||||
} else {
|
for each(var attr in ["border-top-width", "border-bottom-width"]) {
|
||||||
panelFrameHeight = referencePanel.boxObject.height - referencePanel.clientHeight;
|
var val = computedStyle.getPropertyValue(attr);
|
||||||
|
if(val) {
|
||||||
|
var m = pixelRe.exec(val);
|
||||||
|
if(m) panelFrameHeight += parseInt(m[1], 10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
referencePanel.sizeTo(window.outerWidth-30,
|
referencePanel.sizeTo(window.outerWidth-30,
|
||||||
numReferences*referenceHeight+numSeparators*separatorHeight+2*panelFrameHeight);
|
numReferences*referenceHeight+numSeparators*separatorHeight+panelFrameHeight);
|
||||||
if(!panelShowing) _openReferencePanel();
|
if(!panelShowing) _openReferencePanel();
|
||||||
} else if(panelShowing) {
|
} else if(panelShowing) {
|
||||||
referencePanel.hidePopup();
|
referencePanel.hidePopup();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user