diff --git a/mozilla/calendar/resources/content/calendar.js b/mozilla/calendar/resources/content/calendar.js index 7507bf43e1c..0d5aa22d03f 100644 --- a/mozilla/calendar/resources/content/calendar.js +++ b/mozilla/calendar/resources/content/calendar.js @@ -392,7 +392,7 @@ function weekEventItemClick( eventBox, event ) newDate.setDate( eventBox.calendarEventDisplay.event.start.day ); - gCalendarWindow.setSelectedDate( newDate ); + gCalendarWindow.setSelectedDate( newDate, false ); } if ( event ) diff --git a/mozilla/calendar/resources/content/weekView.js b/mozilla/calendar/resources/content/weekView.js index 5fb66f3bc5d..59789b084dd 100644 --- a/mozilla/calendar/resources/content/weekView.js +++ b/mozilla/calendar/resources/content/weekView.js @@ -114,10 +114,26 @@ function WeekView( calendarWindow ) { onSelectionChanged : function( EventSelectionArray ) { - for( i = 0; i < EventSelectionArray.length; i++ ) - { - gCalendarWindow.weekView.selectBoxForEvent( EventSelectionArray[i] ); - } + if( EventSelectionArray.length > 0 ) + { + //if there are selected events. + + //for some reason, this function causes the tree to go into a select / unselect loop + //putting it in a settimeout fixes this. + setTimeout( "gCalendarWindow.weekView.clearSelectedDate();", 1 ); + + var i = 0; + + for( i = 0; i < EventSelectionArray.length; i++ ) + { + gCalendarWindow.weekView.selectBoxForEvent( EventSelectionArray[i] ); + } + } + else + { + //select the proper day + gCalendarWindow.weekView.hiliteSelectedDate(); + } } }