From a9778dfbb471fd9f1fcaedbbb08bd6f51cff3d02 Mon Sep 17 00:00:00 2001 From: "mostafah%oeone.com" Date: Wed, 19 Nov 2003 17:21:56 +0000 Subject: [PATCH] Checked in attachment #135921 and attachment 135927 for bug 210236: [RFE] Currently selected event should be highlighed in the calendar window git-svn-id: svn://10.0.0.236/trunk@149549 18797224-902f-48f8-a5cc-f745e15eee43 --- .../calendar/resources/content/calendar.js | 2 +- .../calendar/resources/content/weekView.js | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) 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(); + } } }