Author: pyaschenko
Date: 2009-02-06 12:07:10 -0500 (Fri, 06 Feb 2009)
New Revision: 12597
Modified:
trunk/framework/impl/src/main/javascript/jquery/jquery-1.3.1.js
Log:
https://jira.jboss.org/jira/browse/RF-5603
Modified: trunk/framework/impl/src/main/javascript/jquery/jquery-1.3.1.js
===================================================================
--- trunk/framework/impl/src/main/javascript/jquery/jquery-1.3.1.js 2009-02-06 15:27:57
UTC (rev 12596)
+++ trunk/framework/impl/src/main/javascript/jquery/jquery-1.3.1.js 2009-02-06 17:07:10
UTC (rev 12597)
@@ -4059,11 +4059,21 @@
doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
body = doc.body, defaultView = doc.defaultView,
prevComputedStyle = defaultView.getComputedStyle(elem, null),
- top = elem.offsetTop, left = elem.offsetLeft;
+ top = elem.offsetTop, left = elem.offsetLeft,
+ isAbsolute = prevComputedStyle.position === "absolute"; //RF: added by
rf-team
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem )
{
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem
&& prevComputedStyle.position !== "fixed" ) {
computedStyle = defaultView.getComputedStyle(elem, null);
- top -= elem.scrollTop, left -= elem.scrollLeft;
+
+ //RF: added by rf-team
+ if ( (!isAbsolute && prevComputedStyle.position === "static") /*
add scroll for statically positioned elements */ ||
+ prevComputedStyle.position === "relative" /* not sure we need this - have
to test */ ||
+ elem === offsetParent /* add scroll offset of offsetParent element */ ) {
+ top -= elem.scrollTop, left -= elem.scrollLeft;
+ isAbsolute = prevComputedStyle.position === "absolute";
+ }
+ //RF: end
+
if ( elem === offsetParent ) {
top += elem.offsetTop, left += elem.offsetLeft;
if ( jQuery.offset.doesNotAddBorder &&
!(jQuery.offset.doesAddBorderForTableAndCells &&
/^t(able|d|h)$/i.test(elem.tagName)) )
@@ -4080,11 +4090,12 @@
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position
=== "static" )
top += body.offsetTop,
left += body.offsetLeft;
-
+
if ( prevComputedStyle.position === "fixed" )
top += Math.max(docElem.scrollTop, body.scrollTop),
left += Math.max(docElem.scrollLeft, body.scrollLeft);
+
return { top: top, left: left };
};