Calendar - Fix changing order (sorting) of users day view

This commit is contained in:
nathangray 2017-03-16 12:56:53 -06:00
parent c65c081585
commit 46c4de0305
2 changed files with 8 additions and 5 deletions

View File

@ -555,7 +555,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
if(!sortable.sortable('instance')) if(!sortable.sortable('instance'))
{ {
sortable.sortable({ sortable.sortable({
cancel: "#divAppboxHeader, .calendar_calWeekNavHeader, .calendar_calDayColHeader, .calendar_plannerHeader", cancel: "#divAppboxHeader, .calendar_calWeekNavHeader, .calendar_plannerHeader",
handle: '.calendar_calGridHeader', handle: '.calendar_calGridHeader',
//placeholder: "srotable_cal_wk_ph", //placeholder: "srotable_cal_wk_ph",
axis:"y", 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 // If in day view, the days need to be re-ordered, avoiding
// the current sort order // the current sort order
app.classes.calendar.views.day.etemplates[0].widgetContainer.iterateOver(function(widget) { 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 // Move the event holding div
widget.set_left((parseInt(widget.options.width) * idx) + 'px'); widget.set_left((parseInt(widget.options.width) * idx) + 'px');
// Re-order the children, or it won't stay // Re-order the children, or it won't stay

View File

@ -579,11 +579,14 @@ var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend
this.drag_create.end = null; this.drag_create.end = null;
this.drag_create.parent = null; this.drag_create.parent = null;
if(this.drag_create.event) if(this.drag_create.event)
{
try
{ {
if(this.drag_create.event.destroy) if(this.drag_create.event.destroy)
{ {
this.drag_create.event.destroy(); this.drag_create.event.destroy();
} }
} catch(e) {}
this.drag_create.event = null; this.drag_create.event = null;
} }
return true; return true;