Bug 969823 - Attendee Dialog: attendee list entries are not properly aligned with time grid;r=Decathlon
authorMakeMyDay
Mon, 21 Apr 2014 18:42:05 +0200
changeset 16052 2fd4762ea2bb6ec40be6758812fd1044ccbcf232
parent 16051 7c838d41bce0ce7ac38167a29d701920a4604991
child 16053 6fc71637650a6916fa0fffdaa0b07fad1acd7f0a
push id10052
push userbv1578@gmail.com
push dateMon, 21 Apr 2014 16:44:49 +0000
treeherdercomm-central@2fd4762ea2bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDecathlon
bugs969823
Bug 969823 - Attendee Dialog: attendee list entries are not properly aligned with time grid;r=Decathlon
calendar/base/content/dialogs/calendar-event-dialog-attendees.js
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.js
@@ -48,16 +48,20 @@ function onLoad() {
 
 
     let zoom = document.getElementById("zoom-menulist");
     let zoomOut = document.getElementById("zoom-out-button");
     let zoomIn = document.getElementById("zoom-in-button");
 
     // Make sure zoom factor is set up correctly (from persisted value)
     setZoomFactor(zoom.value);
+    if(gZoomFactor == 100) {
+        // if zoom factor was not changed, make sure it is applied at least once
+        applyCurrentZoomFactor();
+    }
 
     initTimeRange();
 
     // Check if an all-day event has been passed in (to adapt endDate).
     if (startTime.isDate) {
         startTime = startTime.clone();
         endTime = endTime.clone();
 
@@ -747,16 +751,24 @@ function setZoomFactor(aValue) {
     // Correct zoom factor, if needed 
     aValue = parseInt(aValue, 10) || 100;
 
     if (gZoomFactor == aValue) {
         return aValue;
     }
 
     gZoomFactor = aValue;
+    applyCurrentZoomFactor();
+    return aValue;
+}
+
+/**
+ * applies the current zoom factor for the time grid
+ */
+function applyCurrentZoomFactor() {
     var timebar = document.getElementById("timebar");
     timebar.zoomFactor = gZoomFactor;
     var selectionbar = document.getElementById("selection-bar");
     selectionbar.zoomFactor = gZoomFactor;
     var grid = document.getElementById("freebusy-grid");
     grid.zoomFactor = gZoomFactor;
 
     // Calling onResize() will update the scrollbars and everything else
@@ -768,18 +780,16 @@ function setZoomFactor(aValue) {
     if (scrollbar.hasAttribute("maxpos")) {
         var curpos = scrollbar.getAttribute("curpos");
         var maxpos = scrollbar.getAttribute("maxpos");
         var ratio = curpos / maxpos;
         timebar.scroll = ratio;
         grid.scroll = ratio;
         selectionbar.ratio = ratio;
     }
-
-    return aValue;
 }
 
 /**
  * Force the time grid to show 24 hours.
  *
  * @param aValue        If true, the view will be forced to 24 hours.
  * @return              aValue (for chaining)
  */