diff --git a/calendar/js/app.js b/calendar/js/app.js index 3a2e0e0c1a..90fae5ae42 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -814,7 +814,7 @@ app.classes.calendar = AppJS.extend( 'calendar.calendar_uiforms.ajax_moveEvent', [widget.options.value.id, widget.options.value.owner, widget.options.value.start, widget.options.value.owner, widget.options.value.duration], // Remove loading spinner - function() {widget.div.removeClass('loading');} + function() {if(widget && widget.div) widget.div.removeClass('loading');} ).sendRequest(true); } }, diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index 5522c32289..14ec07985c 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -421,8 +421,8 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM], { var node = this._children[this._children.length-1]; this.removeChild(node); - node.free(); - } + node.free(); + } // Make sure children are in cronological order, or columns are backwards events.sort(function(a,b) { diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 4ac6836734..a7723d3ee2 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -174,8 +174,6 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], // Copy new information this.options.value = event; - var eventId = event.id.match(/-?\d+\.?\d*/g)[0]; - var appName = event.id.replace(/-?\d+\.?\d*/g,''); var app_id = event.app_id ? event.app_id : event.id + (event.recur_type ? ':'+event.recur_date : ''); this._parent.date_helper.set_value(event.start.valueOf ? new Date(event.start) : event.start); var formatted_start = this._parent.date_helper.getValue(); @@ -208,8 +206,8 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], .attr('data-draggable-id',event['id']+'_O'+event.owner+'_C'+(event.owner<0?'group'+Math.abs(event.owner):event.owner)) // Put everything we need for basic interaction here, so it's available immediately - .attr('data-id', eventId || event.id) - .attr('data-app', appName || 'calendar') + .attr('data-id', event.id) + .attr('data-app', event.app || 'calendar') .attr('data-app_id', app_id) .attr('data-start', formatted_start) .attr('data-owner', event.owner) diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index e64a4154a4..bd282b94f8 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -238,7 +238,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz e.originalEvent = event; e.data = {duration: 0}; var event_data = timegrid._get_event_info(this); - var event_widget = timegrid.getWidgetById('event_'+event_data.id); + var event_widget = timegrid.getWidgetById('event_'+event_data.app_id); var sT = event_widget.options.value.start_m; if (typeof this.dropEnd != 'undefined' && this.dropEnd.length == 1) { @@ -376,7 +376,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz if(!event_widget) { // Widget was moved across weeks / owners - event_widget = timegrid.getParent().getWidgetById('event_'+event_data.id); + event_widget = timegrid.getParent().getWidgetById('event_'+event_data.app_id); } if(event_widget) { @@ -1381,7 +1381,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz if (this.onevent_change) { var event_data = this._get_event_info(dom_node); - var event_widget = this.getWidgetById('event_'+event_data.id); + var event_widget = this.getWidgetById('event_'+event_data.app_id); et2_calendar_event.recur_prompt(event_data, jQuery.proxy(function(button_id, event_data) { // No need to continue if(button_id === 'cancel') return false;