зеркало из https://github.com/mozilla/pjs.git
Bug 386480 - View mode is not remembered after Thunderbird restart, patch=giermann@funke.de, r=mickey
This commit is contained in:
Родитель
abce62b95b
Коммит
403ef0e27d
|
@ -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');
|
||||
|
|
Загрузка…
Ссылка в новой задаче