From 2bf00ad44d5afb3be903a05f30701d7fdb110ecd Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 1 Jul 2016 11:57:06 -0600 Subject: [PATCH] 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 --- calendar/js/et2_widget_daycol.js | 3 +++ calendar/js/et2_widget_planner.js | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index 5f7728c2e1..2dd5982d14 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -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')) { diff --git a/calendar/js/et2_widget_planner.js b/calendar/js/et2_widget_planner.js index 83cc8da55a..580962c5ed 100644 --- a/calendar/js/et2_widget_planner.js +++ b/calendar/js/et2_widget_planner.js @@ -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);