Author: pyaschenko
Date: 2009-04-21 12:01:58 -0400 (Tue, 21 Apr 2009)
New Revision: 13742
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
https://jira.jboss.org/jira/browse/RF-6884
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 2009-04-21
15:54:23 UTC (rev 13741)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2009-04-21
16:01:58 UTC (rev 13742)
@@ -679,14 +679,14 @@
// days bar creation
var styleClass;
var bottomStyleClass;
- var htmlTextWeekDayBar='';
+ var htmlTextWeekDayBar=[];
var context;
var eventsStr = this.params.disabled || this.params.readonly ? '' :
'onclick="'+tempStr+'eventCellOnClick(event, this);"
onmouseover="'+tempStr+'eventCellOnMouseOver(event, this);"
onmouseout="'+tempStr+'eventCellOnMouseOut(event, this);"';
if (this.params.showWeekDaysBar)
{
- var htmlTextWeekDayBar = '<tr
id="'+this.params.weekDayBarId+'">';
- if (this.params.showWeeksBar) htmlTextWeekDayBar+='<td
class="rich-calendar-days"><br/></td>';
+ htmlTextWeekDayBar.push('<tr
id="'+this.params.weekDayBarId+'">');
+ if (this.params.showWeeksBar) htmlTextWeekDayBar.push('<td
class="rich-calendar-days"><br/></td>');
var weekDayCounter = this.params.firstWeekDay;
for (var i=0;i<7;i++)
{
@@ -700,25 +700,25 @@
styleClass += " rich-calendar-weekends";
}
if (i==6) styleClass += " rich-right-cell";
- htmlTextWeekDayBar+='<td class="'+styleClass+'"
id="'+context.elementId+'">'+weekDayHtml+'</td>';
+ htmlTextWeekDayBar.push('<td class="'+styleClass+'"
id="'+context.elementId+'">'+weekDayHtml+'</td>');
}
- htmlTextWeekDayBar+='</tr>\n';
+ htmlTextWeekDayBar.push('</tr>\n');
}
// week & weekNumber creation
- var htmlTextWeek='';
+ var htmlTextWeek=[];
var p=0;
this.dayCellClassName = [];
for (k=1;k<7;k++)
{
bottomStyleClass = (k==6 ? "rich-bottom-cell " : "");
- htmlTextWeek+='<tr
id="'+this.params.weekNumberBarId+k+'">';
+ htmlTextWeek.push('<tr
id="'+this.params.weekNumberBarId+k+'">');
if (this.params.showWeeksBar)
{
context = {weekNumber: k, elementId:this.WEEKNUMBER_ELEMENT_ID+k, component:this};
var weekNumberHtml = this.evaluateMarkup(this.params.weekNumberMarkup, context );
- htmlTextWeek+='<td class="rich-calendar-week
'+bottomStyleClass+'"
id="'+context.elementId+'">'+weekNumberHtml+'</td>';
+ htmlTextWeek.push('<td class="rich-calendar-week
'+bottomStyleClass+'"
id="'+context.elementId+'">'+weekNumberHtml+'</td>');
}
// day cells creation
@@ -729,12 +729,12 @@
if (i==6) styleClass+=" rich-right-cell";
this.dayCellClassName.push(styleClass);
- htmlTextWeek+='<td class="'+styleClass+'"
id="'+this.DATE_ELEMENT_ID+p+'" '+
+ htmlTextWeek.push('<td class="'+styleClass+'"
id="'+this.DATE_ELEMENT_ID+p+'" '+
eventsStr+
- '>'+(this.customDayListMarkup ? '<div
class="rich-calendar-cell-div'+(this.params.dayCellClass ? '
'+this.params.dayCellClass : '')+'"></div>' :
'')+'</td>';
+ '>'+(this.customDayListMarkup ? '<div
class="rich-calendar-cell-div'+(this.params.dayCellClass ? '
'+this.params.dayCellClass : '')+'"></div>' :
'')+'</td>');
p++;
}
- htmlTextWeek+='</tr>';
+ htmlTextWeek.push('</tr>');
}
var obj = $(this.POPUP_ID).nextSibling;
@@ -756,7 +756,7 @@
{
var div = obj;
obj = obj.previousSibling;
- Element.replace(div,
htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter);
+ Element.replace(div,
htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar.join('')+htmlTextWeek.join('')+htmlControlsFooter+htmlFooterOptional+htmlTextFooter);
break;
}
} while (obj = obj.nextSibling);
@@ -1152,6 +1152,10 @@
},
doExpand: function(e) {
+ if (!this.isRendered) {
+ this.isRendered = true;
+ this.render();
+ }
this.skipEventOnCollapse = false;
if (e && e.type=='click') this.skipEventOnCollapse = true;
if (!this.params.popup || this.isVisible) return;
@@ -1436,7 +1440,10 @@
this.daysData = null;
}
- this.render();
+ this.isRendered = false;
+ if (this.isVisible) {
+ this.render();
+ };
if (typeof this.afterLoad=='function')
{
@@ -1510,6 +1517,7 @@
render:function() {
//var _d=new Date();
+ this.isRendered = true;
this.todayDate = new Date();
var currentYear = this.getCurrentYear();