myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bara...@apache.org
Subject svn commit: r348512 - /myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/resource/popcalendar.js
Date Wed, 23 Nov 2005 18:30:35 GMT
Author: baranda
Date: Wed Nov 23 10:30:31 2005
New Revision: 348512

URL: http://svn.apache.org/viewcvs?rev=348512&view=rev
Log:
Fixes MYFACES-870

Modified:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/resource/popcalendar.js

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/resource/popcalendar.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/resource/popcalendar.js?rev=348512&r1=348511&r2=348512&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/resource/popcalendar.js
(original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/calendar/resource/popcalendar.js
Wed Nov 23 10:30:31 2005
@@ -51,10 +51,15 @@
       
       objParent = obj.offsetParent;
 
-      while( objParent.tagName.toUpperCase() != "BODY" ){
-        objLeft  -= objParent.scrollLeft;
-        objTop   -= objParent.scrollTop;
-        objParent = objParent.parentNode;
+      // added a try-catch to the next loop (MYFACES-870)
+      try {
+	      while( objParent.tagName.toUpperCase() != "BODY" ){
+	        objLeft  -= objParent.scrollLeft;
+	        objTop   -= objParent.scrollTop;
+	        objParent = objParent.parentNode;
+     	 }
+      } catch (ex) {
+          // ignore
       }
 
       objHeight = obj.offsetHeight;
@@ -517,21 +522,28 @@
 	var	toppos = 0;
 
 	var aTag = ctl;
-	do {
-		aTag = aTag.offsetParent;
-		leftpos	+= aTag.offsetLeft;
-		toppos += aTag.offsetTop;
-	} while(aTag.tagName!="BODY");
+	// Added try-catch to the next loop (MYFACES-870)
+	try {
+		do {
+			aTag = aTag.offsetParent;
+			leftpos	+= aTag.offsetLeft;
+			toppos += aTag.offsetTop;
+		} while(aTag.tagName!="BODY");
+	} catch (ex) {
+       // ignore
+    }
 	
 	var leftScrollOffset = 0;
 	var topScrollOffset = 0;
 	
 	aTag = ctl;
-	do {
-		leftScrollOffset += aTag.scrollLeft;
-		topScrollOffset += aTag.scrollTop;
-		aTag = aTag.parentNode;
-	} while(aTag.tagName!="BODY");
+	// Added try-catch (MYFACES-870)
+	try {
+		do {
+			leftScrollOffset += aTag.scrollLeft;
+			topScrollOffset += aTag.scrollTop;
+			aTag = aTag.parentNode;
+		} while(aTag.tagName!="BODY");
 	
 	var bodyRect = getVisibleBodyRectangle();
 	var cal = document.getElementById("calendar");



Mime
View raw message