mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
Fix dnd & drag resize of non-recurring events
This commit is contained in:
parent
6df97ceae1
commit
e191075303
@ -814,7 +814,7 @@ app.classes.calendar = AppJS.extend(
|
|||||||
'calendar.calendar_uiforms.ajax_moveEvent',
|
'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],
|
[widget.options.value.id, widget.options.value.owner, widget.options.value.start, widget.options.value.owner, widget.options.value.duration],
|
||||||
// Remove loading spinner
|
// Remove loading spinner
|
||||||
function() {widget.div.removeClass('loading');}
|
function() {if(widget && widget.div) widget.div.removeClass('loading');}
|
||||||
).sendRequest(true);
|
).sendRequest(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -421,8 +421,8 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
{
|
{
|
||||||
var node = this._children[this._children.length-1];
|
var node = this._children[this._children.length-1];
|
||||||
this.removeChild(node);
|
this.removeChild(node);
|
||||||
node.free();
|
node.free();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure children are in cronological order, or columns are backwards
|
// Make sure children are in cronological order, or columns are backwards
|
||||||
events.sort(function(a,b) {
|
events.sort(function(a,b) {
|
||||||
|
@ -174,8 +174,6 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
// Copy new information
|
// Copy new information
|
||||||
this.options.value = event;
|
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 : '');
|
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);
|
this._parent.date_helper.set_value(event.start.valueOf ? new Date(event.start) : event.start);
|
||||||
var formatted_start = this._parent.date_helper.getValue();
|
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))
|
.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
|
// Put everything we need for basic interaction here, so it's available immediately
|
||||||
.attr('data-id', eventId || event.id)
|
.attr('data-id', event.id)
|
||||||
.attr('data-app', appName || 'calendar')
|
.attr('data-app', event.app || 'calendar')
|
||||||
.attr('data-app_id', app_id)
|
.attr('data-app_id', app_id)
|
||||||
.attr('data-start', formatted_start)
|
.attr('data-start', formatted_start)
|
||||||
.attr('data-owner', event.owner)
|
.attr('data-owner', event.owner)
|
||||||
|
@ -238,7 +238,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
|
|||||||
e.originalEvent = event;
|
e.originalEvent = event;
|
||||||
e.data = {duration: 0};
|
e.data = {duration: 0};
|
||||||
var event_data = timegrid._get_event_info(this);
|
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;
|
var sT = event_widget.options.value.start_m;
|
||||||
if (typeof this.dropEnd != 'undefined' && this.dropEnd.length == 1)
|
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)
|
if(!event_widget)
|
||||||
{
|
{
|
||||||
// Widget was moved across weeks / owners
|
// 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)
|
if(event_widget)
|
||||||
{
|
{
|
||||||
@ -1381,7 +1381,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz
|
|||||||
if (this.onevent_change)
|
if (this.onevent_change)
|
||||||
{
|
{
|
||||||
var event_data = this._get_event_info(dom_node);
|
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) {
|
et2_calendar_event.recur_prompt(event_data, jQuery.proxy(function(button_id, event_data) {
|
||||||
// No need to continue
|
// No need to continue
|
||||||
if(button_id === 'cancel') return false;
|
if(button_id === 'cancel') return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user