From 904e35497dd38dd1f09b4cef42060ab9de60f3a0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 15 Feb 2010 17:50:33 +0000 Subject: [PATCH] Monotone-Parent: eb200b682dbedf18d1ac5a67f76d81304b347bad Monotone-Revision: ab4b1f0c6f4310a6bc308b8c2fc0afacfdfffe2e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-02-15T17:50:33 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/WebServerResources/SchedulerUIDnD.js | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6360e1a2e..c4da4a0bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,10 @@ "eventInside" DIV to contain the title and draw the border. This avoids the overflow of extra pixels added to the DIV heights for start and end ghosts. + (SOGoEventDragController.attachToDayNode): we determine whether + the event cell are for an invitation, in which case the dragging + event will be aborted even though the user is technically the + "owner" of the represented event. 2010-02-13 Wolfgang Sourdeau diff --git a/UI/WebServerResources/SchedulerUIDnD.js b/UI/WebServerResources/SchedulerUIDnD.js index 97d8e8ac3..10ba4ce1b 100644 --- a/UI/WebServerResources/SchedulerUIDnD.js +++ b/UI/WebServerResources/SchedulerUIDnD.js @@ -904,6 +904,7 @@ SOGoEventDragController.prototype = { eventCells: null, eventType: null, + eventIsInvitation: false, title: null, folderClass: null, @@ -930,6 +931,7 @@ SOGoEventDragController.prototype = { this.eventCells = eventCells; this.ghostController = new SOGoEventDragGhostController(); + this._determineEventInvitation(eventCells[0]); this._determineEventType(eventCells[0]); this._prepareEventType(); this._determineTitleAndFolderClass(); @@ -939,7 +941,7 @@ SOGoEventDragController.prototype = { this.onDragStartBound = this.onDragStart.bindAsEventListener(this); for (var i = 0; i < eventCells.length; i++) { eventCells[i].observe("mousedown", this.onDragStartBound, false); - if (eventCells[i].editable) { + if (eventCells[i].editable && !this.eventIsInvitation) { eventCells[i].addClassName("draggable"); } } @@ -979,7 +981,8 @@ SOGoEventDragController.prototype = { if ((!this.eventCells && (target.hasClassName("clickableHourCell") || target.hasClassName("day")) - || (this.eventCells && this.eventCells[0].editable))) { + || (this.eventCells && this.eventCells[0].editable + && !this.eventIsInvitation))) { var utilities = SOGoEventDragUtilities(); utilities.setEventType(this.eventType); @@ -1029,6 +1032,17 @@ SOGoEventDragController.prototype = { return false; }, + _determineEventInvitation: function SEDC__determineEventType(node) { + var isInvitation = false; + for (var i = 0; !isInvitation && i < userStates.length; i++) { + var inside = node.select("DIV.eventInside")[0]; + if (inside.hasClassName(userStates[i])) + isInvitation = true; + } + + this.eventIsInvitation = isInvitation; + }, + _determineEventType: function SEDC__determineEventType(node) { var type = "unknown";