diff --git a/NEWS b/NEWS index 6f2e27f28..bffabb569 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ Bug fixes - don't load 'background' attribute (#2437) - fixed validation of subscribed folders (#2583) - fixed display of folder names in messages filter editor (#2569) + - fixed contextual menu of the current calendar view (#2557) 2.1.1b (2013-12-04) ------------------- diff --git a/UI/Templates/SchedulerUI/UIxCalDayView.wox b/UI/Templates/SchedulerUI/UIxCalDayView.wox index 388bd015e..676d65d54 100644 --- a/UI/Templates/SchedulerUI/UIxCalDayView.wox +++ b/UI/Templates/SchedulerUI/UIxCalDayView.wox @@ -22,12 +22,14 @@ diff --git a/UI/Templates/SchedulerUI/UIxCalMonthView.wox b/UI/Templates/SchedulerUI/UIxCalMonthView.wox index c1a47488a..7cf06172c 100644 --- a/UI/Templates/SchedulerUI/UIxCalMonthView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMonthView.wox @@ -23,6 +23,7 @@ @@ -30,6 +31,7 @@ diff --git a/UI/Templates/SchedulerUI/UIxCalMulticolumnDayView.wox b/UI/Templates/SchedulerUI/UIxCalMulticolumnDayView.wox index 641ce988a..62ee604e3 100644 --- a/UI/Templates/SchedulerUI/UIxCalMulticolumnDayView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMulticolumnDayView.wox @@ -6,7 +6,7 @@ xmlns:rsrc="OGo:url" xmlns:label="OGo:label"> @@ -34,7 +34,7 @@ /> diff --git a/UI/Templates/SchedulerUI/UIxCalWeekView.wox b/UI/Templates/SchedulerUI/UIxCalWeekView.wox index 018be928f..6b5debbb1 100644 --- a/UI/Templates/SchedulerUI/UIxCalWeekView.wox +++ b/UI/Templates/SchedulerUI/UIxCalWeekView.wox @@ -22,12 +22,14 @@ diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index b1609aac6..81b8e5928 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -151,11 +151,17 @@ function getSelectedFolder() { } function onMenuNewEventClick(event) { - newEventFromWidget(this, "event"); + var target = document.menuTarget; + if (/(minutes\d{2}|dayHeader)/.test(target.className)) + target = target.parentNode; + newEventFromWidget(target, "event"); } function onMenuNewTaskClick(event) { - newEventFromWidget(this, "task"); + var target = document.menuTarget; + if (/(minutes\d{2}|dayHeader)/.test(target.className)) + target = target.parentNode; + newEventFromWidget(target, "task"); } function _editEventId(id, calendar, recurrence) { @@ -718,7 +724,6 @@ function onViewEventCallback(http) { } } else { - view = $("calendarView"); top -= cell.up("DIV.day").scrollTop; } @@ -1173,13 +1178,11 @@ function restoreCurrentDaySelection(div) { } function loadPreviousView(event) { - var previousArrow = $$("A.leftNavigationArrow").first(); - onCalendarGotoDay(previousArrow); + onCalendarGotoDay($("leftNavigationArrow")); } function loadNextView(event) { - var nextArrow = $$("A.rightNavigationArrow").first(); - onCalendarGotoDay(nextArrow); + onCalendarGotoDay($("rightNavigationArrow")); } function changeDateSelectorDisplay(day, keepCurrentDay) { @@ -1701,6 +1704,11 @@ function newBaseEventDIV(eventRep, event, eventText) { var eventCell = createElement("div"); eventCell.cname = event[0]; eventCell.calendar = event[1]; + var startDate = new Date(event[5]*1000); + if (startDate) { + eventCell.writeAttribute('day', startDate.getDayString()); + eventCell.writeAttribute('hour', startDate.getHourString()); + } // if (event[8] == 1) // eventCell.addClassName("private"); // else if (event[8] == 2) @@ -2439,8 +2447,7 @@ function onCalendarSelectDay(event) { // Target is not an event -- unselect all events. listOfSelection = $("eventsList"); deselectAll(); - preventDefault(event); - return false; + return true; } if (listOfSelection) { @@ -2778,17 +2785,20 @@ function onMenuSharing(event) { } function onMenuCurrentView(event) { + var target = getTarget(event); $("eventDialog").hide(); if (this.hasClassName('event')) { + // Select event cell var onClick = onCalendarSelectEvent.bind(this); onClick(event, true); + target = this; } - popupMenu(event, 'currentViewMenu', this); + popupMenu(event, 'currentViewMenu', target); } function onMenuAllDayView(event) { $("eventDialog").hide(); - popupMenu(event, 'allDayViewMenu', this); + popupMenu(event, 'allDayViewMenu', getTarget(event)); } function configureDragHandles() { diff --git a/UI/WebServerResources/SchedulerUIDnD.js b/UI/WebServerResources/SchedulerUIDnD.js index 7e74d18f9..1e8d18eef 100644 --- a/UI/WebServerResources/SchedulerUIDnD.js +++ b/UI/WebServerResources/SchedulerUIDnD.js @@ -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) {