Bug 1647928 - Fix dragging the event bar in the attendees dialog. r=pmorris a=wsmwk
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 29 Jun 2020 21:11:58 +0300
changeset 39488 dcc756af25ee9422492b980b5933b16172b00c7b
parent 39487 33b9e7a5703975410b1a144a24811eae6b910aea
child 39489 8a29fc272c72f1c8b6919d16ad87e74e03dcf48f
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewerspmorris, wsmwk
bugs1647928
Bug 1647928 - Fix dragging the event bar in the attendees dialog. r=pmorris a=wsmwk
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
@@ -134,26 +134,26 @@ var eventBar = {
     let outer = document.getElementById("outer");
     outer.addEventListener("dragstart", this);
     outer.addEventListener("dragover", this);
     outer.addEventListener("dragend", this);
   },
   handleEvent(event) {
     switch (event.type) {
       case "dragstart": {
-        this.dragStartX = event.clientX;
+        this.dragStartX = event.clientX + freebusyGrid.scrollLeft;
         let img = document.createElement("img");
         img.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
         event.dataTransfer.setDragImage(img, 0, 0);
         event.dataTransfer.effectAllowed = "move";
         break;
       }
       case "dragover": {
         // Snap dragging movements to half of a minor column width.
-        this.dragDistance = Math.round((event.clientX - this.dragStartX) / 15) * 15;
+        this.dragDistance = Math.round((event.clientX + freebusyGrid.scrollLeft - this.dragStartX) / 15) * 15;
         this.eventBarTop.style.transform = this.eventBarBottom.style.transform = `translateX(${this.dragDistance}px)`;
         break;
       }
       case "dragend": {
         this.dragStartX = null;
         this.eventBarTop.style.transform = this.eventBarBottom.style.transform = null;
 
         let duration = cal.createDuration();