From 7fedeeaa44f82e2ea1ea81feebc6322845bd1222 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Mon, 16 Apr 2007 14:00:22 +0000 Subject: [PATCH] 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 --- source/web/scripts/ajax/common.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/web/scripts/ajax/common.js b/source/web/scripts/ajax/common.js index e3eb69da63..932c9a25fa 100644 --- a/source/web/scripts/ajax/common.js +++ b/source/web/scripts/ajax/common.js @@ -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"; } } };