From 46c4de03054f2ca27f513fb0ec0a3615fee6b7de Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 16 Mar 2017 12:56:53 -0600 Subject: [PATCH] Calendar - Fix changing order (sorting) of users day view --- calendar/js/app.js | 4 ++-- calendar/js/et2_widget_view.js | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index e7940e4092..351aff3e6f 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -555,7 +555,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( if(!sortable.sortable('instance')) { sortable.sortable({ - cancel: "#divAppboxHeader, .calendar_calWeekNavHeader, .calendar_calDayColHeader, .calendar_plannerHeader", + cancel: "#divAppboxHeader, .calendar_calWeekNavHeader, .calendar_plannerHeader", handle: '.calendar_calGridHeader', //placeholder: "srotable_cal_wk_ph", axis:"y", @@ -601,7 +601,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( // If in day view, the days need to be re-ordered, avoiding // the current sort order app.classes.calendar.views.day.etemplates[0].widgetContainer.iterateOver(function(widget) { - var idx = sortedArr.indexOf(widget.options.owner); + var idx = sortedArr.indexOf(widget.options.owner.toString()); // Move the event holding div widget.set_left((parseInt(widget.options.width) * idx) + 'px'); // Re-order the children, or it won't stay diff --git a/calendar/js/et2_widget_view.js b/calendar/js/et2_widget_view.js index ad2a4ddb21..6c05ac4246 100644 --- a/calendar/js/et2_widget_view.js +++ b/calendar/js/et2_widget_view.js @@ -580,10 +580,13 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend this.drag_create.parent = null; if(this.drag_create.event) { - if(this.drag_create.event.destroy) + try { - this.drag_create.event.destroy(); - } + if(this.drag_create.event.destroy) + { + this.drag_create.event.destroy(); + } + } catch(e) {} this.drag_create.event = null; } return true;