Bug 386480 - View mode is not remembered after Thunderbird restart, patch=giermann@funke.de, r=mickey

This commit is contained in:
michael.buettner%sun.com 2007-09-21 12:28:07 +00:00
Родитель abce62b95b
Коммит 403ef0e27d
3 изменённых файлов: 20 добавлений и 24 удалений

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

@ -215,24 +215,7 @@ function ltnMinimonthPick(minimonth)
if (document.getElementById("displayDeck").selectedPanel !=
document.getElementById("calendar-view-box")) {
var view = currentView();
// If we've never shown the view before, we need to do some special
// things here.
if (!view.initialized) {
showCalendarView('month');
view = currentView();
cdt = cdt.getInTimezone(view.timezone);
cdt.isDate = true;
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);
showCalendarView(gLastShownCalendarView);
}
cdt = cdt.getInTimezone(currentView().timezone);
@ -363,6 +346,21 @@ function ltnOnLoad(event)
modeBoxAttrModified,
true);
// find last shown calendar view (persist="checked")
var availableViews = getViewDeck();
var numChilds = availableViews.childNodes.length;
for (var i = 0; i < numChilds; i++) {
var view = availableViews.childNodes[i];
var command = document.getElementById(view.id+"-command");
if (command && command.getAttribute("checked") == "true") {
gLastShownCalendarView = view.id.substring(0, view.id.indexOf('-'));
break;
}
}
if (!gLastShownCalendarView) {
gLastShownCalendarView = 'month';
}
gMiniMonthLoading = true;
var today = new Date();

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

@ -193,10 +193,10 @@
<command id="switch2calendar" oncommand="ltnSwitch2Calendar()"/>
<command id="switch2task" oncommand="ltnSwitch2Task()"/>
<command id="cmd_toggleTodayPane" oncommand="toggleTodayPaneinMailMode()"/>
<command id="day-view-command" oncommand="showCalendarView('day')"/>
<command id="week-view-command" oncommand="showCalendarView('week')"/>
<command id="multiweek-view-command" oncommand="showCalendarView('multiweek')"/>
<command id="month-view-command" oncommand="showCalendarView('month')"/>
<command id="day-view-command" oncommand="showCalendarView('day')" persist="checked"/>
<command id="week-view-command" oncommand="showCalendarView('week')" persist="checked"/>
<command id="multiweek-view-command" oncommand="showCalendarView('multiweek')" persist="checked"/>
<command id="month-view-command" oncommand="showCalendarView('month')" persist="checked"/>
<command id="calendar-delete-command" oncommand="ltnDeleteSelectedItem()" disabledwhennoeventsselected="true"/>
<command id="calendar_new_todo_command" oncommand="createTodoWithDialog(getSelectedCalendar());"/>
<command id="modify_todo_command" oncommand="editToDo()"/>

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

@ -147,8 +147,6 @@ function ltnSwitch2Calendar() {
deck.selectedPanel = document.getElementById("calendar-view-box");
// show the last displayed type of calendar view
if(gLastShownCalendarView == null)
gLastShownCalendarView = 'week';
showCalendarView(gLastShownCalendarView);
document.commandDispatcher.updateCommands('mail-toolbar');