Fix some bugs in drag to create event

- Firefox opened 2 popups, one for span and one for end time
- Dragging existing events longer or shorter created a new event also
- Did not work in dayview
- Categories from category planner were not set
This commit is contained in:
nathangray 2016-07-01 11:57:06 -06:00
parent c7f63a5e0a
commit 2bf00ad44d
2 changed files with 19 additions and 1 deletions

View File

@ -1058,6 +1058,9 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
*/
click: function(_ev)
{
// Drag to create in progress
if(this._parent.drag_create.start !== null) return;
// Click on the title
if (jQuery(_ev.target).hasClass('calendar_calAddEvent'))
{

View File

@ -167,6 +167,21 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
}
},
/**
* If dragging to resize an event, abort drag to create
*
* @param {jQuery.Event} event
* @param {Object} ui
*/
start: function(event, ui)
{
if(planner.drag_create.start)
{
// Abort drag to create, we're dragging to resize
planner._drag_create_end({});
}
},
/**
* Triggered at the end of resizing the calEvent.
*
@ -646,7 +661,7 @@ var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.e
// Get its children immediately
egw.json(
this.getInstanceManager().app+'.etemplate_widget_menupopup.ajax_get_options.etemplate',
'EGroupware\\Api\\Etemplate\\Widget\\Select::ajax_get_options',
['select-cat',',,,calendar,'+cat_id[i]],
function(data) {
labels = labels.concat(data);