Bug 1647170 - Fix "ReferenceError: rearrangeAttendees is not defined" in calendar event window. r=pmorris
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 22 Jun 2020 13:51:38 +1200
changeset 29942 d051d1812f3ca38505bc4e5779330b603dee20e3
parent 29941 f9c5843e733a8aef11908431ae18b1a0179030a2
child 29943 7e4d2d1cab11d7e423b5f3eaed2617add76e480b
push id17608
push usergeoff@darktrojan.net
push dateTue, 23 Jun 2020 01:22:30 +0000
treeherdercomm-central@d051d1812f3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspmorris
bugs1647170
Bug 1647170 - Fix "ReferenceError: rearrangeAttendees is not defined" in calendar event window. r=pmorris
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/content/lightning-item-iframe.xhtml
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -405,16 +405,28 @@ function onLoad() {
       organizer.commonName = item.calendar.getProperty("organizerCN");
       organizer.role = "REQ-PARTICIPANT";
       organizer.participationStatus = "ACCEPTED";
       organizer.isOrganizer = true;
       window.organizer = organizer;
     }
   }
 
+  window.addEventListener("resize", () => {
+    let { attendeesInRow, maxLabelWidth } = rearrangeAttendees(
+      window.attendees,
+      document,
+      window.attendeesInRow,
+      window.maxLabelWidth
+    );
+
+    window.attendeesInRow = attendeesInRow;
+    window.maxLabelWidth = maxLabelWidth;
+  });
+
   // we store the recurrence info in the window so it
   // can be accessed from any location. since the recurrence
   // info is a property of the parent item we need to check
   // whether or not this item is a proxy or a parent.
   let parentItem = item;
   if (parentItem.parentItem != parentItem) {
     parentItem = parentItem.parentItem;
   }
--- a/calendar/lightning/content/lightning-item-iframe.xhtml
+++ b/calendar/lightning/content/lightning-item-iframe.xhtml
@@ -27,17 +27,16 @@
     %eventDialogDTD;
 ]>
 
 <!-- Vbox id is changed during execution to allow different treatment.
      document.loadOverlay() will not work on this one. -->
 <window id="calendar-event-dialog-inner"
       onload="onLoad();"
       onunload="onEventDialogUnload();"
-      onresize="rearrangeAttendees();"
       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       xmlns:html="http://www.w3.org/1999/xhtml">
 
   <!-- JavaScript includes -->
   <script src="chrome://lightning/content/lightning-item-iframe.js"/>
   <script src="chrome://calendar/content/calendar-dialog-utils.js"/>
   <script src="chrome://calendar/content/calendar-ui-utils.js"/>
   <script src="chrome://calendar/content/calApplicationUtils.js"/>