[richfaces-svn-commits] JBoss Rich Faces SVN: r2381 - in trunk: ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Aug 21 13:00:51 EDT 2007


Author: pyaschenko
Date: 2007-08-21 13:00:51 -0400 (Tue, 21 Aug 2007)
New Revision: 2381

Modified:
   trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
   trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-645 fixed

Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js	2007-08-21 16:27:39 UTC (rev 2380)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js	2007-08-21 17:00:51 UTC (rev 2381)
@@ -147,7 +147,7 @@
    	}
 }
 
-Richfaces.browser={isIE6: /MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent)};
+Richfaces.browser={isIE6: (!window.opera && /MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent))};
 
 Richfaces.eval = function(template, object) {
 	var value = '';

Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2007-08-21 16:27:39 UTC (rev 2380)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2007-08-21 17:00:51 UTC (rev 2381)
@@ -14,16 +14,16 @@
 	// jointPoint: {x:,y:} or ('top-left','top-right','bottom'-left,'bottom-right')
 	// direction:  ('top-left','top-right','bottom'-left,'bottom-right', 'auto')
 	// offset: {x:,y:}
-	
+
 	var elementDim = Richfaces.Calendar.getOffsetDimensions(element);
-	
 	var baseElementDim;
 	var baseOffset;
 	
-	if (baseElement.left)
+	if (baseElement.left!=undefined)
 	{
 		baseElementDim = {width: baseElement.width, height: baseElement.height};
 		baseOffset = [baseElement.left, baseElement.top];
+		
 	} else
 	{
 		baseElementDim = Richfaces.Calendar.getOffsetDimensions(baseElement);
@@ -101,8 +101,15 @@
 			}
 			
 		}
-	}	
+	}
 	
+	if (element.offsetParent && element.offsetParent!=document.body)
+	{
+		var offset=Position.cumulativeOffset(element.offsetParent);
+		ox -= offset[0];
+		oy -= offset[1];
+	}
+	
 	element.style.left = ox + 'px';
 	element.style.top = oy + 'px';
 };
@@ -552,14 +559,22 @@
 		this.setPopupEvents(base);*/
 		
 		//rect calculation
-		var offsetBase = Position.cumulativeOffset(base);
+		var offsetBase1 = Position.cumulativeOffset(baseInput);
+		var offsetBase2 = Position.cumulativeOffset(baseButton);
+		
+		var offsetBase = [offsetBase1[0]<offsetBase2[0] ? offsetBase1[0] : offsetBase2[0],
+						  offsetBase1[1]<offsetBase2[1] ? offsetBase1[1] : offsetBase2[1]];
+		
 		var offsetDimBase = Richfaces.Calendar.getOffsetDimensions(base);
 		var offsetDimButton = Richfaces.Calendar.getOffsetDimensions(baseButton);
 		var offsetDimInput = Richfaces.Calendar.getOffsetDimensions(baseInput);
-		var o = {left: offsetBase[0], top: offsetBase[1],
-				 width: offsetDimBase.width, height: (offsetDimButton.height>offsetDimInput.height ? offsetDimButton.height : offsetDimInput.height)};
+		var o = {left: offsetBase[0],
+				 top: offsetBase[1],
+				 width: offsetDimBase.width,
+				 height: (offsetDimButton.height>offsetDimInput.height ? offsetDimButton.height : offsetDimInput.height)};
 
 		Richfaces.Calendar.setElementPosition(e, o, this.params.jointPoint, this.params.direction);
+
 		if (Richfaces.browser.isIE6)
 		{
 			iframe.style.left = e.style.left;




More information about the richfaces-svn-commits mailing list