Bug 931492 - Thunderbird status bar and SeaMonkey messaging tab not shown/broken due to error in calendar-extract.js r=philipp
authorMerike Sell <merike.sell@eesti.ee>
Tue, 26 Nov 2013 21:36:38 +0200
changeset 16932 115b4d5ecf6b806cedf2a1f5e63d5c3c05e67547
parent 16931 42a96b98eeeccbb60e6b7311bcd31ff01ec2c33b
child 16933 6ec8a0de056778f0cc148c8a1fd17bfe5d81b5b3
push id1074
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:47:23 +0000
treeherdercomm-beta@6b791b5369ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs931492
Bug 931492 - Thunderbird status bar and SeaMonkey messaging tab not shown/broken due to error in calendar-extract.js r=philipp
calendar/base/content/calendar-extract.js
--- a/calendar/base/content/calendar-extract.js
+++ b/calendar/base/content/calendar-extract.js
@@ -204,16 +204,21 @@ let calendarExtract = {
         if (window.top.document.location == "chrome://messenger/content/messenger.xul") {
             // covers initial load and folder change
             let folderTree = document.getElementById("folderTree");
             folderTree.addEventListener("select", this.setState, false);
 
             // covers selection change in a folder
             let msgTree = window.top.GetThreadTree();
             msgTree.addEventListener("select", this.setState, false);
+
+            window.addEventListener("unload", () => {
+                folderTree.removeEventListener("select", this.setState, false);
+                msgTree.removeEventListener("select", this.setState, false);
+            }, false);
         }
     },
 
     setState: function setState() {
         let eventButton = document.getElementById("extractEventButton");
         let taskButton = document.getElementById("extractTaskButton");
         let hdrEventButton = document.getElementById("hdrExtractEventButton");
         let hdrTaskButton = document.getElementById("hdrExtractTaskButton");
@@ -231,9 +236,9 @@ let calendarExtract = {
         if (hdrEventButton)
             hdrEventButton.disabled = state;
         if (hdrTaskButton)
             hdrTaskButton.disabled = state;
         contextMenu.disabled = contextState;
     }
 };
 
-calendarExtract.addListeners();
+window.addEventListener("load", calendarExtract.addListeners.bind(calendarExtract), false);