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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Dec 4 12:12:20 EST 2007


Author: pyaschenko
Date: 2007-12-04 12:12:19 -0500 (Tue, 04 Dec 2007)
New Revision: 4459

Modified:
   trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-1494

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-12-04 17:03:39 UTC (rev 4458)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2007-12-04 17:12:19 UTC (rev 4459)
@@ -818,12 +818,6 @@
 		{
 			Event.stopObserving(window.document, "click", this.eventOnCollapse, false);
 			
-			if (this.eventOnCollapseFlag)
-			{
-				Event.stopObserving(window.document, "click", this.eventOnCollapse, false);
-				this.eventOnCollapseFlag = false;
-			}
-			
 			var iframe=null;
 			if (Richfaces.browser.isIE6) iframe = $(this.IFRAME_ID);
 			if (iframe) Element.hide(iframe);
@@ -847,7 +841,8 @@
 		}
 	},
 	
-	doExpand: function() {
+	doExpand: function(e) {
+		if (e) this.skipEventOnCollapse = true;
 		if (!this.params.popup || this.isVisible) return;
 		
 		var element = $(this.id);
@@ -918,11 +913,17 @@
 		}
 	},
 	
-	doSwitch: function() {
-		this.isVisible ? this.doCollapse() : this.doExpand();
+	doSwitch: function(e) {
+		this.isVisible ? this.doCollapse() : this.doExpand(e);
 	},
 	
 	eventOnCollapse: function (e) {
+		if (this.skipEventOnCollapse)
+		{
+			this.skipEventOnCollapse = false;
+			return true;
+		}
+
 		if (Event.element(e).id == this.POPUP_BUTTON_ID || (!this.params.enableManualInput && Event.element(e).id == this.INPUT_DATE_ID) ) return true;
 		
 		Position.prepare();




More information about the richfaces-svn-commits mailing list