Add some missed cases for adding new events:

- click on day in month view
- context menu with no specific time (month view)
- fix all day non-blocking in header no longer created a new event
This commit is contained in:
Nathan Gray 2016-03-09 18:10:43 +00:00
parent d105b8c751
commit 3ea15bf95c
3 changed files with 32 additions and 2 deletions

View File

@ -1322,7 +1322,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
// Get a little smarter with the context
if(!extra)
{
var context = {}
var context = {};
if(egw.dataGetUIDdata(_events[0].id) && egw.dataGetUIDdata(_events[0].id).data)
{
// Found data in global cache
@ -1337,6 +1337,17 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
_events[0].iface.getWidget().options.value || {}
extra = {};
}
// Try to pull whatever we can from the event
else if (jQuery.isEmptyObject(context) && _action.menu_context && (_action.menu_context.event.target))
{
var target = _action.menu_context.event.target;
while(target != null && target.parentNode && jQuery.isEmptyObject(target.dataset))
{
target = target.parentNode;
}
context = extra = target.dataset;
}
if(context.date) extra.date = context.date;
if(context.app) extra.app = context.app;
if(context.app_id) extra.app_id = context.app_id;

View File

@ -1012,7 +1012,7 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
return false;
}
// Header, but not the hidden event indicators that are in there
else if (this.header.has(_ev.target).length && !$j('.hiddenEventBefore',this.header).has(_ev.target) ||
else if (this.header.has(_ev.target).length && !$j('.hiddenEventBefore',this.header).has(_ev.target).length ||
this.header.is(_ev.target)
)
{

View File

@ -1643,6 +1643,25 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
}
}
}
// No time grid, click on a day
else if (this.options.granularity === 0 &&
($j(_ev.target).hasClass('event_wrapper') || $j(_ev.target).hasClass('.calendar_calDayCol'))
)
{
// Default handler to open a new event at the selected time
var target = $j(_ev.target).hasClass('event_wrapper') ? _ev.target.parentNode : _ev.target;
var options = {
date: target.dataset.date || this.options.date,
hour: target.dataset.hour || this._parent.options.day_start,
minute: target.dataset.minute || 0
};
if (this.options.owner != app.calendar.state.owner)
{
options.owner = this.options.owner;
}
this.egw().open(null, 'calendar', 'add', options, '_blank');
return false;
}
},
/**