Fix bug 714431 - New Event... and New Task... are always disabled (regression). r=philipp,a=philipp
authorWolfgang Sourdeau <wsourdeau@inverse.ca>
Tue, 10 Jan 2012 19:58:55 +0100
changeset 11404 b0157434c3f2ac7521738ec465d2a91ec660ce09
parent 11403 f9ec15220d709021ffe3b75c50e28026cfad292d
child 11405 9907a8d0e3a659cb2dcf16628aa090c872b28e00
push id6
push userbienvenu@nventure.com
push dateWed, 16 May 2012 22:24:51 +0000
treeherdertry-comm-central@ac395aea3008 [default view] [failures only]
reviewersphilipp, philipp
bugs714431
Fix bug 714431 - New Event... and New Task... are always disabled (regression). r=philipp,a=philipp
calendar/base/content/calendar-chrome-startup.js
--- a/calendar/base/content/calendar-chrome-startup.js
+++ b/calendar/base/content/calendar-chrome-startup.js
@@ -70,16 +70,22 @@ function commonInitCalendar() {
 
     // Set up window pref observers
     calendarWindowPrefs.init();
 
     // Check if the system colors should be used
     if (cal.getPrefSafe("calendar.view.useSystemColors", false)) {
         document.documentElement.setAttribute("systemcolors", "true");
     }
+
+    // Ensure the new items commands state can be setup properly even when no
+    // calendar support refreshes (i.e. the "onLoad" notification)
+    if (!cal.getCalendarManager().getCalendars({}).some(function(x) x.canRefresh)) {
+        calendarUpdateNewItemsCommand();
+    }
 }
 
 /**
  * Common unload steps for calendar chrome windows.
  */
 function commonFinishCalendar() {
     // Unload the calendar manager
     unloadCalendarManager();