http://issues.alfresco.com/browse/AWC-1260
http://issues.alfresco.com/browse/AWC-1170
Improvement of alignment for pop-up panel - was rendering off the top of the screen if the preview text was very large vertically.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5877 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-06-07 10:46:36 +00:00
parent 4532170872
commit f50258fa99
4 changed files with 17 additions and 4 deletions

View File

@@ -345,6 +345,7 @@ function getContextPath()
if (elWidth > maxwidth) elWidth = maxwidth;
}
var docWidth = this.getDocumentWidth();
var shiftedLeft = false;
if (pos.x + 20 + elWidth < docWidth)
{
el.style.left = (pos.x + 20) + "px";
@@ -353,6 +354,7 @@ function getContextPath()
{
// Shifting X coord left - overflow
el.style.left = (pos.x + 20 - ((pos.x + elWidth) - docWidth)) + "px";
shiftedLeft = true;
}
if (pos.y + 12 + elHeight < this.getDocumentHeight())
{
@@ -361,7 +363,17 @@ function getContextPath()
else
{
// Shifting Y coord up - overflow
el.style.top = (pos.y - elHeight + 4) + "px";
if (shiftedLeft == true)
{
el.style.top = (pos.y - elHeight + 4) + "px";
}
else
{
// we have room to shift vertically without overwriting the pop-up icon
var ypos = (pos.y - elHeight + 4);
if (ypos < 0) ypos = 0;
el.style.top = ypos + "px";
}
}
}
};