Author: pyaschenko
Date: 2007-10-25 13:03:59 -0400 (Thu, 25 Oct 2007)
New Revision: 3545
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
small fix: selectedDateElement changed to selectedDateCellId that contains ID string (was
dom element)
RF-1132
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-10-25
16:30:07 UTC (rev 3544)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-25
17:03:59 UTC (rev 3545)
@@ -453,7 +453,7 @@
this.todayDate = new Date();
- this.selectedDateElement;
+ this.selectedDateCellId = null;
this.firstWeekendDayNumber = 6-this.params.firstWeekDay;
this.secondWeekendDayNumber = (this.params.firstWeekDay>0 ?
7-this.params.firstWeekDay : 0);
@@ -1026,9 +1026,9 @@
//var _d=new Date();
- if (this.selectedDateElement) {
- Element.classNames(this.selectedDateElement).remove("rich-calendar-select");
- this.selectedDateElement = null;
+ if (this.selectedDateCellId) {
+ Element.classNames(this.selectedDateCellId).remove("rich-calendar-select");
+ this.selectedDateCellId = null;
}
for (var k=1;k<7;k++)
@@ -1143,7 +1143,7 @@
}
if (selectedflag && dataobj._month==0 && dataobj.day==selecteddate)
{
- this.selectedDateElement = element;
+ this.selectedDateCellId = element.id;
e.add("rich-calendar-select");
}
@@ -1326,8 +1326,8 @@
{
// find cell and change style class
var e = $(this.DATE_ELEMENT_ID+(this.firstDateIndex +
this.selectedDate.getDate()-1));
- if (this.selectedDateElement) Element.removeClassName(this.selectedDateElement,
"rich-calendar-select");
- this.selectedDateElement = e;
+ if (this.selectedDateCellId) Element.removeClassName(this.selectedDateCellId,
"rich-calendar-select");
+ this.selectedDateCellId = e.id;
Element.addClassName(e, "rich-calendar-select");
this.renderHeader();
@@ -1344,10 +1344,10 @@
{
this.selectedDate = null;
field.value = "";
- if (this.selectedDateElement)
+ if (this.selectedDateCellId)
{
- Element.removeClassName(this.selectedDateElement,
"rich-calendar-select");
- this.selectedDateElement = null;
+ Element.removeClassName(this.selectedDateCellId, "rich-calendar-select");
+ this.selectedDateCellId = null;
this.renderHeader();
this.renderFooter();
}
@@ -1378,10 +1378,10 @@
{
this.selectedDate = null;
$(this.INPUT_DATE_ID).value = "";
- if (this.selectedDateElement)
+ if (this.selectedDateCellId)
{
- Element.removeClassName(this.selectedDateElement, "rich-calendar-select");
- this.selectedDateElement = null;
+ Element.removeClassName(this.selectedDateCellId, "rich-calendar-select");
+ this.selectedDateCellId = null;
}
this.renderHeader();
this.renderFooter();
@@ -1399,6 +1399,11 @@
this.currentDate.setDate(1);
this.onUpdate();
}
+ else
+ {
+ // highlight Selected Date
+
+ }
}
});