Monotone-Parent: c80330da9a8ac34c6b7766f390131ea49ac47d5b

Monotone-Revision: 7d2120f897825c5610c6111ccba1a14c02fdcb07

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-07-08T20:14:47
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle 2008-07-08 20:14:47 +00:00
parent fa626352b5
commit 0494428139

View file

@ -399,9 +399,13 @@ function performSearchCallback(http) {
var offset = Element.cumulativeOffset(MailEditor.currentField);
var top = offset[1] - offsetScroll[1] + node.offsetHeight + 3;
var height = 'auto';
if (data.length > 5) {
height = 5 * node.getHeight() + 'px';
}
var heightDiff = window.height() - offset[1];
var nodeHeight = node.getHeight();
if ((data.length * nodeHeight) > heightDiff)
// Limit the size of the popup to the window height, minus 12 pixels
height = parseInt(heightDiff/nodeHeight) * nodeHeight - 12 + 'px';
menu.setStyle({ top: top + "px",
left: offset[0] + "px",
height: height,