[richfaces-svn-commits] JBoss Rich Faces SVN: r2740 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Sep 4 12:53:47 EDT 2007


Author: pyaschenko
Date: 2007-09-04 12:53:46 -0400 (Tue, 04 Sep 2007)
New Revision: 2740

Modified:
   trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
RF-805

Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2007-09-04 15:27:08 UTC (rev 2739)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2007-09-04 16:53:46 UTC (rev 2740)
@@ -92,7 +92,7 @@
 
 	function getSizeElement() {
 		var element;
-		if (document.compatMode=='CSS1Compat') {
+		if (RichFaces.navigatorType() != "OPERA" && document.compatMode=='CSS1Compat') {
 			element = document.documentElement;
 		} else {
 			element = document.body;
@@ -567,7 +567,7 @@
 				var cw = getSizeElement().clientWidth;
 				if (RichFaces.navigatorType() == "OPERA")
 				 	_left = (cw - eContentDiv.style.width.replace("px", "")) / 2;
-				 else {
+				else {
 				 	var _width = Richfaces.getComputedStyleSize(eContentDiv, "width");
 				 	if (isNaN(_width))
 				 		_width = eContentDiv.clientWidth;
@@ -585,10 +585,16 @@
 				_top = parseInt(options.top, 10);
 			} else {
 				var cw = getSizeElement().clientHeight;
-				var _height = Richfaces.getComputedStyleSize(eContentDiv, "height");
-				if (isNaN(_height))
-					_height = eContentDiv.clientHeight;
-				_top = (cw - _height) / 2;
+				if (RichFaces.navigatorType() == "OPERA")
+				{
+				 	_top = (cw - eContentDiv.style.height.replace("px", "")) / 2;
+				}
+				else {
+					var _height = Richfaces.getComputedStyleSize(eContentDiv, "height");
+					if (isNaN(_height))
+						_height = eContentDiv.clientHeight;
+					_top = (cw - _height) / 2;
+				}
 			}
 
 			this.setTop(_top);
@@ -748,7 +754,12 @@
 			}
 		}
 
-		var newSize = Richfaces.getComputedStyleSize(eContentDiv, "height");
+		// Avoid currentStyle bug in opera
+		if (RichFaces.navigatorType() != "OPERA")
+			newSize = Richfaces.getComputedStyleSize(eContentDiv, "height");
+		else
+			newSize = parseInt(eContentDiv.style.height.replace("px", ""), 10);
+
 		var oldSize = newSize;
 		newSize += diff.deltaHeight || 0;
 




More information about the richfaces-svn-commits mailing list