merge of '16bafd35c923b43175977acf723114a90f37d677'

and 'c38113be1f70b01613925ed47bf4491f5536862d'

Monotone-Parent: 16bafd35c923b43175977acf723114a90f37d677
Monotone-Parent: c38113be1f70b01613925ed47bf4491f5536862d
Monotone-Revision: 96be8fb544ada3cb6a58b0caa0bfb99522dac8db

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-07-08T23:06:08
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-07-08 23:06:08 +00:00
+7 -3
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,