Fix bug 689589 - Lightning doesn't work in Thunderbird 9.0a2 and 10.0a1, startup errors [document.getElementById("calendarDisplayDeck") is null]. r=philipp
authorMatthew Mecca <matthew.mecca@gmail.com>
Sat, 01 Oct 2011 13:51:00 +0200
changeset 9446 007485db1000460d0ab4515613c47ddf885af42f
parent 9445 1b02fbd2f3b0af778f5aa887bf1bf98cfdc86c45
child 9447 b83fba0bc529ab4fcab3a920dc0ac1cb2e4d385a
push idunknown
push userunknown
push dateunknown
reviewersphilipp
bugs689589
Fix bug 689589 - Lightning doesn't work in Thunderbird 9.0a2 and 10.0a1, startup errors [document.getElementById("calendarDisplayDeck") is null]. r=philipp
calendar/base/content/calendar-task-view.js
calendar/lightning/content/lightning-migration.xul
calendar/lightning/content/messenger-overlay-sidebar.js
--- a/calendar/base/content/calendar-task-view.js
+++ b/calendar/base/content/calendar-task-view.js
@@ -292,12 +292,12 @@ function taskViewObserveDisplayDeckChang
     // In case we find that the task view has been made visible, we refresh the view.
     if (id == "calendar-task-box") {
         taskViewUpdate(
             document.getElementById("task-tree-filtergroup").value || "all");
     }
 }
 
 // Install event listeners for the display deck change.
-document.addEventListener("load", function () {
+window.addEventListener("load", function () {
   document.getElementById("calendarDisplayDeck").
     addEventListener("select", taskViewObserveDisplayDeckChange, true);
-  }, true);
+  }, false);
--- a/calendar/lightning/content/lightning-migration.xul
+++ b/calendar/lightning/content/lightning-migration.xul
@@ -52,23 +52,23 @@
 [
 ]>
 
 <overlay id="ltnMigrationOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     <script type="application/javascript" src="chrome://calendar/content/calendar-migration-dialog.js"/>
     <script type="application/javascript"><![CDATA[
         function checkOld() {
-            document.removeEventListener("load", checkOld, true);
+            window.removeEventListener("load", checkOld, false);
             var calMgr = Components.classes["@mozilla.org/calendar/manager;1"]
                                    .getService(Components.interfaces.calICalendarManager);
             var cals = calMgr.getCalendars({});
             if (!cals.length) {
                 // There are no calendars, so we are running for the first time
                 gDataMigrator.checkAndMigrate();
             }
         }
-        document.addEventListener("load", checkOld, true);
+        window.addEventListener("load", checkOld, false);
     ]]></script>
 
     <deck id="calendarDisplayDeck"/>
 
 </overlay>
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -182,17 +182,17 @@ window.addEventListener("load", function
     tabmail.registerTabMonitor(calendarTabMonitor);
 }, false);
 
 
 function ltnOnLoad(event) {
 
     // nuke the onload, or we get called every time there's
     // any load that occurs
-    document.removeEventListener("load", ltnOnLoad, true);
+    window.removeEventListener("load", ltnOnLoad, false);
 
     document.getElementById("calendarDisplayDeck").
       addEventListener("select", LtnObserveDisplayDeckChange, true);
 
     // Take care of common initialization
     commonInitCalendar();
 
     // Add an unload function to the window so we don't leak any listeners
@@ -464,9 +464,9 @@ const gCalSetupMailContext = {
 function calInitMessageMenu() {
     calInitMessageMenu.origFunc();
 
     document.getElementById("markMenu").disabled = (gCurrentMode != 'mail');
 }
 calInitMessageMenu.origFunc = InitMessageMenu;
 InitMessageMenu = calInitMessageMenu;
 
-document.addEventListener("load", ltnOnLoad, true);
+window.addEventListener("load", ltnOnLoad, false);