Back out bug 463080 - unifinder / views focus cleanup (caused 3 regressions)
authorPrzemyslaw Bialik <firefox@poczta.neostrada.pl>
Sun, 01 Feb 2009 11:08:07 +0100
changeset 1816 a62cac409cf7fc103c22462a9db8d90be0c9be2f
parent 1815 926acda4ef6d81da41bd84c14edd10c7a43360db
child 1817 c550e59d094e01591ec133724e4c256a72676545
push idunknown
push userunknown
push dateunknown
bugs463080
Back out bug 463080 - unifinder / views focus cleanup (caused 3 regressions)
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-views.js
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -386,16 +386,17 @@ function unifinderSelect(event) {
         currentView().goToDay(selectedItems[0].startDate);
     }
 
     // Set up the selected items in the view. Pass in true, so we don't end
     // up in a circular loop
     currentView().setSelectedItems(selectedItems.length, selectedItems, true);
     currentView().centerSelectedItems();
     calendarController.onSelectionChanged({detail: selectedItems});
+    document.getElementById("unifinder-search-results-tree").focus();
 }
 
 /**
  * Handler function for keypress in the unifinder.
  *
  * @param aEvent        The DOM Key event.
  */
 function unifinderKeyPress(aEvent) {
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -281,17 +281,16 @@ var calendarViewController = {
  * @param type      The type of view to show
  * @param event     (optional) A DOM event that caused the view to show.
  */
 function showCalendarView(type, event) {
     if (isSunbird()) {
         sbSwitchToView(type, event);
     } else if (document.getElementById('switch2calendar').getAttribute('checked')) {
         ltnShowCalendarView(type, event);
-        currentView().focus();
     }
     onCalendarViewResize(event);
 }
 
 /**
  * This function acts like showCalendarView, but does not bring the view to the front
  * if the application is showing other elements (i.e Lightning).
  *
@@ -581,16 +580,17 @@ function observeViewDaySelect(event) {
                 mainDate = month.clone();
                 maxVisibleDays = visibleDays;
             }
         }
         jsMainDate = new Date(mainDate.year, mainDate.month, mainDate.day);
     }
 
     getMinimonth().selectDate(jsDate, jsMainDate);
+    currentView().focus();
 }
 
 /**
  * Provides a neutral way to get the minimonth, regardless of whether we're in
  * Sunbird or Lightning.
  *
  * @return          The XUL minimonth element.
  */