Bug 330386 Clicking on day on calendar pane brings always to month view instead of last view, r=dmose

This commit is contained in:
jminta%gmail.com 2006-04-15 13:23:58 +00:00
Родитель 6c1c1abab5
Коммит 8ec7b3f77a
2 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -70,7 +70,8 @@ interface calIDecoratedView : nsISupports
readonly attribute AUTF8String observerID;
/**
* The displayCalendar of the calICalendarView that is embedded
* The displayCalendar of the embedded calICalendarView. This *must* be set
* prior to calling goToDay the first time.
*/
attribute calICalendar displayCalender;

Просмотреть файл

@ -68,7 +68,21 @@ function ltnMinimonthPick(minimonth)
if (document.getElementById("displayDeck").selectedPanel !=
document.getElementById("calendar-view-box")) {
showCalendarView('month');
var view = currentView();
// We set the display calendar on the views in showCalendarView
// the first time they are shown.
if (!view.displayCalendar) {
showCalendarView('month');
view.goToDay(cdt);
return;
}
// showCalendarView is going to use the value passed in to switch to
// foo-view, so strip off the -view part of the current view.
var viewID = view.getAttribute("id");
viewID = viewID.substring(0, viewID.indexOf('-'));
showCalendarView(viewID);
}
currentView().goToDay(cdt);