Back out
bug 463080 - unifinder / views focus cleanup (caused 3 regressions)
--- 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.
*/