Bug 1647170 - Fix "ReferenceError: rearrangeAttendees is not defined" in calendar event window. r+a=pmorris
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 22 Jun 2020 13:51:38 +1200
changeset 39492 2b321be11b3568503c9e93f272a6887a09b781f0
parent 39491 95c7a87cd30cc3754b1b88feca5c50e79d49340c
child 39493 9f7fb887944f27835f5b36213d9c4fd604b2ad71
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
bugs1647170
Bug 1647170 - Fix "ReferenceError: rearrangeAttendees is not defined" in calendar event window. r+a=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"/>