[richfaces-svn-commits] JBoss Rich Faces SVN: r4941 - 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
Thu Dec 20 13:03:41 EST 2007


Author: pyaschenko
Date: 2007-12-20 13:03:41 -0500 (Thu, 20 Dec 2007)
New Revision: 4941

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

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-20 17:36:49 UTC (rev 4940)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2007-12-20 18:03:41 UTC (rev 4941)
@@ -406,7 +406,7 @@
 	var mm; var dd; var hh; var min;
     var result = pattern.replace(/(\\\\|\\[yMdaHhm])|(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
         function($1,$2,$3) {
-        	if ($2.length!=0) return $2.charAt(1);
+        	if ($2) return $2.charAt(1);
 			switch ($3) {
 	            case 'y':
 	            case 'yy':  return date.getYear().toString().slice(-2);
@@ -731,6 +731,8 @@
 		if(this.params.submitFunction)	this.submitFunction = this.params.submitFunction.bind(this);
 		this.prepareEvents();
 		
+		this.doSetCellEvents=true;
+		
 		// add onclick event handlers to input field and popup button
 		if (this.params.popup && !this.params.disabled)
 		{
@@ -874,7 +876,7 @@
   		
 		this.timePatternHtml = timePattern.replace(/(\\\\|\\[yMdaHhm])|(H{1,2}|h{1,2}|m{2}|a)/g,
 			function($1,$2,$3) {
-				if ($2.length!=0) return $2.charAt(1);
+				if ($2) return $2.charAt(1);
 				switch ($3) {
 		            case 'a'  : return '</td><td>'+calendar.createSpinnerTable(id+'TimeSign')+'</td><td>';
 		            case 'H'  :
@@ -1410,6 +1412,7 @@
 		this.selectedDateCellId = this.clearEffect(this.selectedDateCellId, this.highlightEffect2, "rich-calendar-select", "rich-calendar-btn");
 		
 		//var _d=new Date();
+		
 		var obj = $(this.params.weekNumberBarId+"1");
 		for (var k=1;k<7;k++)
 		{
@@ -1441,7 +1444,7 @@
 			while (element)
 			{
 				// TODO fix start/stop event's calls
-				this.stopCellEvents(element);
+				//this.stopCellEvents(element);
 				
 				dataobj.elementId=element.id;
 				dataobj.date=new Date(currentYear, currentMonth+dataobj._month, dataobj.day);
@@ -1511,7 +1514,7 @@
 					e.add("rich-calendar-select");
 				}
 				
-				this.setCellEvents(element);
+				if (this.doSetCellEvents) this.setCellEvents(element);
 				p++;
 
 				dataobj = this.days[p];
@@ -1532,7 +1535,7 @@
 				element.style.height = "0px";
 			}
 		}*/
-		
+		this.doSetCellEvents = false;
 	},
 
 	renderHF: function()
@@ -1964,7 +1967,7 @@
 					new E('td',{'class': 'rich-calendar-month'},
 					[
 						new ET(function (context) { return Richfaces.evalMacro("currentMonthControl", context)})
-					]),
+					]),				
 					new E('td',{'class': 'rich-calendar-tool'},
 					[
 						new ET(function (context) { return Richfaces.evalMacro("nextMonthControl", context)})




More information about the richfaces-svn-commits mailing list