Bug 969823 - Attendee Dialog: attendee list entries are not properly aligned with time grid;r=Decathlon a=philipp
authorMakeMyDay
Tue, 22 Apr 2014 09:22:24 +0200
changeset 16098 fa9e1c8817a2f9218eff74fc7109466ac2d7285a
parent 16097 710fcab096a8b43e36f83d770d11ea35354d6527
child 16099 83644ae8e82bad0bdbd4b89ce9eb0fe598b21f52
push id53
push userbv1578@gmail.com
push dateTue, 22 Apr 2014 07:23:11 +0000
reviewersDecathlon, philipp
bugs969823
Bug 969823 - Attendee Dialog: attendee list entries are not properly aligned with time grid;r=Decathlon a=philipp
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
@@ -47,16 +47,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();
 
@@ -744,16 +748,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
@@ -765,18 +777,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)
  */