www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit bbd686f8bbafd4430ee8197e5aa78a29a3518a5c
parent 6750535319ef4584b8ed66d07aea4636ca71a0fb
Author: Simon Kornblith <simon@simonster.com>
Date:   Tue, 17 Jan 2012 00:31:43 -0500

A true platform-general solution to the panel sizing problem

Diffstat:
Mchrome/content/zotero/integration/quickFormat.js | 15++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js @@ -24,6 +24,7 @@ */ var Zotero_QuickFormat = new function () { + const pixelRe = /^([0-9]+)px$/ var initialized, io, qfs, qfi, qfiWindow, qfiDocument, qfe, qfb, qfbHeight, keepSorted, showEditor, referencePanel, referenceBox, referenceHeight = 0, separatorHeight = 0, currentLocator, currentLocatorLabel, currentSearchTime, dragging, panel, @@ -741,15 +742,19 @@ var Zotero_QuickFormat = new function () { } if(!panelFrameHeight) { - if(Zotero.isWin || Zotero.isMac) { - panelFrameHeight = 1; - } else { - panelFrameHeight = referencePanel.boxObject.height - referencePanel.clientHeight; + panelFrameHeight = referencePanel.boxObject.height - referencePanel.clientHeight; + var computedStyle = window.getComputedStyle(referenceBox, null); + for each(var attr in ["border-top-width", "border-bottom-width"]) { + var val = computedStyle.getPropertyValue(attr); + if(val) { + var m = pixelRe.exec(val); + if(m) panelFrameHeight += parseInt(m[1], 10); + } } } referencePanel.sizeTo(window.outerWidth-30, - numReferences*referenceHeight+numSeparators*separatorHeight+2*panelFrameHeight); + numReferences*referenceHeight+numSeparators*separatorHeight+panelFrameHeight); if(!panelShowing) _openReferencePanel(); } else if(panelShowing) { referencePanel.hidePopup();