Bug 1493034 - Check if header view has already loaded at iMIP bar startup; r=MakeMyDay,mkmelin DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 17 Dec 2018 22:40:23 +1300
changeset 34013 e1b29b3607c4f67fb2bcdf1118ba15dc7132ffe1
parent 34012 9c7743f3523920e86fb4c0c84d9dc6cd12e9ed45
child 34014 f245d6f5d3b32a5ca10a7871eb4d1231550af3fc
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersMakeMyDay, mkmelin
bugs1493034
Bug 1493034 - Check if header view has already loaded at iMIP bar startup; r=MakeMyDay,mkmelin DONTBUILD
calendar/lightning/content/imip-bar.js
mail/base/content/msgHdrView.js
--- a/calendar/lightning/content/imip-bar.js
+++ b/calendar/lightning/content/imip-bar.js
@@ -511,10 +511,14 @@ var ltnImipBar = {
                 aParticipantStatus,
                 response
             );
         }
         return false;
     }
 };
 
-addEventListener("messagepane-loaded", ltnImipBar.load, true);
+if (document.getElementById("msgHeaderView").loaded) {
+    ltnImipBar.load();
+} else {
+    addEventListener("messagepane-loaded", ltnImipBar.load, true);
+}
 addEventListener("messagepane-unloaded", ltnImipBar.unload, true);
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -252,16 +252,17 @@ function OnLoadMsgHeaderPane() {
     if (menu) {  // May not be available yet.
       menu.hidden = opensAreHidden;
     }
   }
 
   // Dispatch an event letting any listeners know that we have loaded
   // the message pane.
   var headerViewElement = document.getElementById("msgHeaderView");
+  headerViewElement.loaded = true;
   headerViewElement.dispatchEvent(new Event("messagepane-loaded",
     { bubbles: false, cancelable: true }));
 
   initInlineToolbox("header-view-toolbox", "header-view-toolbar",
                     "CustomizeHeaderToolbar", function() {
                       UpdateJunkButton();
                       UpdateReplyButtons();
                     });