From 1aa86a0858fdce4a4c3453ba5bbe17c979eb9aaa Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 25 Jan 2010 17:08:17 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: b8785a107526f1e90244fbdab4a759e95b15a5b0 Monotone-Revision: 03ab73ff63dcd41936ff772c87444389b1448a27 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-01-25T17:08:17 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++++ UI/WebServerResources/SchedulerUI.js | 38 ++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71a21fc87..0eee7c954 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-25 Francis Lachapelle + + * UI/WebServerResources/SchedulerUI.js + (restoreCurrentDaySelection): fixed selection of current day in + mini-calendar. + 2010-01-24 Ludovic Marcotte * Reorganized the layout of automated tests. diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index e1f044cb5..a4741f382 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -635,7 +635,7 @@ function gotoToday() { function setDateSelectorContent(content) { var div = $("dateSelectorView"); - div.innerHTML = content; + div.update(content); if (currentDay.length > 0) restoreCurrentDaySelection(div); @@ -810,25 +810,19 @@ function tasksListCallback(http) { } function restoreCurrentDaySelection(div) { - var elements = $(div).getElementsByTagName("a"); - var day = null; - var i = 9; - while (!day && i < elements.length) - { - day = elements[i].day; - i++; - } - - if (day - && day.substr(0, 6) == currentDay.substr(0, 6)) { - for (i = 0; i < elements.length; i++) { - day = elements[i].day; - if (day && day == currentDay) { - var td = $(elements[i]).getParentWithTagName("td"); - if (document.selectedDate) - document.selectedDate.deselect(); - $(td).selectElement(); - document.selectedDate = td; + var elements = $(div).select("TD.activeDay SPAN"); + if (elements.size()) { + var day = elements[0].readAttribute('day'); + if (day.substr(0, 6) == currentDay.substr(0, 6)) { + for (var i = 0; i < elements.length; i++) { + day = elements[i].readAttribute('day'); + if (day && day == currentDay) { + var td = $(elements[i]).getParentWithTagName("td"); + if (document.selectedDate) + document.selectedDate.deselect(); + $(td).selectElement(); + document.selectedDate = td; + } } } } @@ -910,7 +904,7 @@ function changeCalendarDisplay(data, newView) { // Deselect day in date selector if (document.selectedDate) document.selectedDate.deselect(); - + // Select day in date selector var selectedLink = $$('table#dateSelectorTable span[day='+day+']'); if (selectedLink.length > 0) { @@ -918,7 +912,7 @@ function changeCalendarDisplay(data, newView) { $(selectedCell).selectElement(); document.selectedDate = selectedCell; } - + // Scroll to event if (scrollEvent) { preventAutoScroll = false;