From b7d77a85888a210b31a47218a941473a88eb4f6a Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Thu, 7 Oct 2004 15:34:17 +0000 Subject: [PATCH] fix contextmenu bug when in which occures when in scrolling down in Gecko --- phpgwapi/js/htmlarea/plugins/ContextMenu/context-menu.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/htmlarea/plugins/ContextMenu/context-menu.js b/phpgwapi/js/htmlarea/plugins/ContextMenu/context-menu.js index 63d000ce36..3d2e8233eb 100755 --- a/phpgwapi/js/htmlarea/plugins/ContextMenu/context-menu.js +++ b/phpgwapi/js/htmlarea/plugins/ContextMenu/context-menu.js @@ -385,8 +385,12 @@ ContextMenu.prototype.popupMenu = function(ev) { } if (!HTMLArea.is_ie) { - var dx = x + div.offsetWidth - window.innerWidth + 4; - var dy = y + div.offsetHeight - window.innerHeight + 4; +// var dx = x + div.offsetWidth - window.innerWidth + 4; +// var dy = y + div.offsetHeight - window.innerHeight + 4; + + var dx = x + div.offsetWidth - window.innerWidth - window.pageXOffset + 4; + var dy = y + div.offsetHeight - window.innerHeight - window.pageYOffset + 4; + if (dx > 0) x -= dx; if (dy > 0) y -= dy; div.style.left = x + "px";