From 3de70526d07db6fe6101f5a3feec388e111f375d Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 5 Jul 2016 13:14:10 -0600 Subject: [PATCH] Fix some bugs in drag to create event - Firefox needed drag helper explicitly removed - bug in move exceptions caused SQL error --- calendar/inc/class.calendar_ui.inc.php | 5 +++++ calendar/js/et2_widget_timegrid.js | 1 + calendar/js/et2_widget_view.js | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index c8855c1a4f..9614dffca4 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -613,6 +613,11 @@ class calendar_ui public function update_client($event_id, Api\DateTime $recurrence_date = null) { if(!$event_id) return false; + if(is_string($event_id) && strpos($event_id,':') !== FALSE) + { + list($event_id, $date) = explode(':',$event_id); + $recurrence_date = new Api\DateTime($date); + } // Directly update stored data. // Make sure we have the whole event diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 204fa1b87f..399a3a9164 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -324,6 +324,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. // Cancel drag to create, we're dragging an existing event timegrid.drag_create.start = null; + timegrid._drag_create_end(); }) .on('mousemove', function(event) { timegrid._get_time_from_position(event.clientX, event.clientY); diff --git a/calendar/js/et2_widget_view.js b/calendar/js/et2_widget_view.js index b8001ed90d..5c0b3789fd 100644 --- a/calendar/js/et2_widget_view.js +++ b/calendar/js/et2_widget_view.js @@ -488,6 +488,10 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend _drag_create_end: function(end) { this.div.css('cursor',''); + if(typeof end === 'undefined') + { + end = {}; + } if(this.drag_create.start && end.date && JSON.stringify(this.drag_create.start.date) !== JSON.stringify(end.date))