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 33159 e1b29b3607c4
parent 33158 9c7743f35239
child 33160 f245d6f5d3b3
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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();
                     });