Fix issues with contextual menu in calendars

Creating an event or a task using the contextual menu will now consider
the day and hour of the menu position (fixes #2557).
The next/previous day/month menu options have been fixed.
The menu will now disappear when clicking outside the contextual menu on
the calendar area.
This commit is contained in:
Francis Lachapelle
2014-01-28 15:36:48 -05:00
parent 9580a8f8ee
commit 342ad84a24
7 changed files with 31 additions and 19 deletions

View File

@@ -1007,9 +1007,7 @@ SOGoEventDragController.prototype = {
onDragStart: function SEDC_onDragStart(event) {
var target = getTarget(event);
if (eventIsLeftClick(event) && (target.nodeType == 1)) {
if (target.hasClassName("minutes15") ||
target.hasClassName("minutes30") ||
target.hasClassName("minutes45"))
if (/minutes\d{2}/.test(target.className))
target = target.parentNode;
if ((!this.eventCells
&& (target.hasClassName("clickableHourCell")
@@ -1059,11 +1057,8 @@ SOGoEventDragController.prototype = {
Event.observe(window, "mouseup", this.onDragStopBound);
this.onDragModeBound = this.onDragMode.bindAsEventListener(this);
Event.observe(document.body, "mousemove", this.onDragModeBound);
Event.stop(event);
}
}
return false;
},
_determineEventInvitation: function SEDC__determineEventType(node) {