Author: bleathem
Date: 2014-01-17 03:36:04 -0500 (Fri, 17 Jan 2014)
New Revision: 23282
Modified:
branches/enterprise/3.3.1.SP4/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
RF-13493: Corrected the fix to RF-11368, taking the window scroll position into account
when positioning the menu
Modified:
branches/enterprise/3.3.1.SP4/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
branches/enterprise/3.3.1.SP4/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2014-01-16
13:47:42 UTC (rev 23281)
+++
branches/enterprise/3.3.1.SP4/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2014-01-17
08:36:04 UTC (rev 23282)
@@ -522,6 +522,9 @@
var parOffset = Position.cumulativeOffset(this.element);
var divOffset = Position.cumulativeOffset(innerDiv);
var scrollOffset = Position.realOffset(this.element);
+ var windowScroll = {};
+ windowScroll.top = window.pageYOffset !== null ? window.pageYOffset :
document.body.scrollTop;
+ windowScroll.left = window.pageXOffset !== null ? window.pageXOffset :
document.body.scrollLeft;
var deltaX = divOffset[0] - parOffset[0];
var deltaY = divOffset[1] - parOffset[1];
@@ -572,8 +575,8 @@
if (!foundPos) {
layerPos = this.calcPosition(listPos[0].jointPoint, listPos[0].direction)
}
- this.layer.style.left = layerPos.left + hOffset - deltaX - this.left - scrollOffset[0]
+ "px";
- this.layer.style.top = layerPos.top + vOffset - deltaY - this.top - scrollOffset[1] +
"px";
+ this.layer.style.left = layerPos.left + hOffset - deltaX - this.left -
(scrollOffset.left - windowScroll.left) + "px";
+ this.layer.style.top = layerPos.top + vOffset - deltaY - this.top - (scrollOffset.top -
windowScroll.top) + "px";
this.layer.style.width = this.layer.clientWidth + "px";
Show replies by date