Fix to Ajax pop-up panel positioning to work in JBossPortal

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5496 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-04-16 14:00:22 +00:00
parent 1bead745ae
commit 7fedeeaa44

View File

@@ -235,23 +235,25 @@ function getContextPath()
if (elWidth > maxwidth) elWidth = maxwidth;
}
var docWidth = YAHOO.util.Dom.getDocumentWidth();
if (pos[0] + elWidth < docWidth)
//log(" Element X:" + pos[0] + " doc width:" + YAHOO.util.Dom.getDocumentWidth());
if (pos[0] + 20 + elWidth < docWidth)
{
el.style.left = pos[0];
el.style.left = (pos[0] + 20) + "px";
}
else
{
el.style.left = pos[0] - ((pos[0] + elWidth) - docWidth);
//log(" Shifting X coord left - overflow");
el.style.left = (pos[0] + 20 - ((pos[0] + elWidth) - docWidth)) + "px";
}
//log(" Element Y:" + pos[1] + " doc height:" + YAHOO.util.Dom.getDocumentHeight());
if (pos[1] + 16 + elHeight < YAHOO.util.Dom.getDocumentHeight())
if (pos[1] - 12 + elHeight < YAHOO.util.Dom.getDocumentHeight())
{
el.style.top = pos[1] + 12;
el.style.top = (pos[1] + 12) + "px";
}
else
{
//log(" ***Changing position - will overflow");
el.style.top = pos[1] - elHeight - 4;
//log(" Shifting Y coord up - overflow");
el.style.top = (pos[1] - elHeight - 4) + "px";
}
}
};