From 376a681d9420d881c79b386e3616f6efdbed03a4 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 11 Dec 2008 17:25:19 +0000 Subject: [PATCH] Fix for bug #3163 Monotone-Parent: 9b6f0c65763b57f4f4f3198f2400f943060f7bb4 Monotone-Revision: d85d7d8fee328504d17e9458ec53c9819d09b3bc Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-12-11T17:25:19 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/SchedulerUI.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 04a895605..7c18f7614 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -1298,7 +1298,7 @@ function onListFilterChange() { } function selectMonthInMenu(menu, month) { - var entries = menu.childNodes[1].childNodesWithTag("LI"); + var entries = $(menu).select("LI"); for (i = 0; i < entries.length; i++) { var entry = entries[i]; var entryMonth = entry.getAttribute("month"); @@ -1309,17 +1309,15 @@ function selectMonthInMenu(menu, month) { } } -function selectYearInMenu(menu, month) { - var entries = menu.childNodes[1].childNodes; +function selectYearInMenu(menu, year) { + var entries = $(menu).select("LI"); for (i = 0; i < entries.length; i++) { var entry = entries[i]; - if (entry.tagName == "LI") { - var entryMonth = entry.innerHTML; - if (entryMonth == month) - entry.addClassName("currentMonth"); - else - entry.removeClassName("currentMonth"); - } + var entryYear = entry.innerHTML.strip(); + if (entryYear == year) + entry.addClassName("currentMonth"); + else + entry.removeClassName("currentMonth"); } } @@ -1344,14 +1342,14 @@ function popupMonthMenu(event) { function onMonthMenuItemClick(event) { var month = '' + this.getAttribute("month"); - var year = '' + $("yearLabel").innerHTML; + var year = '' + $("yearLabel").innerHTML.strip(); changeDateSelectorDisplay(year + month + "01", true); } function onYearMenuItemClick(event) { var month = '' + $("monthLabel").getAttribute("month");; - var year = '' + this.innerHTML; + var year = '' + this.innerHTML.strip(); changeDateSelectorDisplay(year + month + "01", true); }