Fix bug 499542 - View menu entries Rotate View and Workweek Days Only are always disabled (regression). r=ssitter

--HG--
extra : rebase_source : 58bcdd9014c39d8956845d8708ec16e41a202094
This commit is contained in:
Philipp Kewisch 2009-06-24 20:47:52 +02:00
Родитель edad9f56a6
Коммит dfba8d3aa5
1 изменённых файлов: 16 добавлений и 12 удалений

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

@ -181,14 +181,10 @@ var calendarController = {
case "calendar_export_selection_command":
return this.item_selected;
case "calendar_toggle_orientation_command":
return this.isCalendarInForeground() &&
gCurrentMode &&
gCurrentMode == "calendar" &&
return this.isInMode("calendar") &&
currentView().supportsRotation;
case "calendar_toggle_workdays_only_command":
return this.isCalendarInForeground() &&
gCurrentMode &&
gCurrentMode == "calendar" &&
return this.isInMode("calendar") &&
currentView().supportsWorkdaysOnly;
case "calendar_publish_selected_events_command":
return this.item_selected;
@ -209,14 +205,11 @@ var calendarController = {
// changing things.
case "calendar_show_unifinder_command":
case "calendar_mode_calendar":
return this.isCalendarInForeground() &&
gCurrentMode &&
gCurrentMode == "calendar";
return this.isInMode("calendar");
case "calendar_mode_task":
return this.isCalendarInForeground() &&
gCurrentMode &&
gCurrentMode == "task";
return this.isInMode("task");
default:
if (this.defaultController && !this.isCalendarInForeground()) {
// The delete-button demands a special handling in mail-mode
@ -445,6 +438,17 @@ var calendarController = {
return isSunbird() || (gCurrentMode && gCurrentMode != "mail");
},
isInMode: function cC_isInMode(mode) {
switch (mode) {
case "mail":
return !isCalendarInForeground();
case "calendar":
return isSunbird() || (gCurrentMode && gCurrentMode == "calendar");
case "task":
return !isSunbird() && (gCurrentMode && gCurrentMode == "task");
}
},
onSelectionChanged: function cC_onSelectionChanged(aEvent) {
var selectedItems = aEvent.detail;
calendarController.item_selected = selectedItems && (selectedItems.length > 0);