|
@ -1130,8 +1130,15 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
if (me.options.editable.updateTime) { |
|
|
if (me.options.editable.updateTime) { |
|
|
if ('start' in item.data) props.start = item.data.start.valueOf(); |
|
|
|
|
|
if ('end' in item.data) props.end = item.data.end.valueOf(); |
|
|
|
|
|
|
|
|
if ('start' in item.data) { |
|
|
|
|
|
props.start = item.data.start.valueOf(); |
|
|
|
|
|
|
|
|
|
|
|
if ('end' in item.data) { |
|
|
|
|
|
// we store a duration here in order not to change the width
|
|
|
|
|
|
// of the item when moving it.
|
|
|
|
|
|
props.duration = item.data.end.valueOf() - props.start; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if (me.options.editable.updateGroup) { |
|
|
if (me.options.editable.updateGroup) { |
|
|
if ('group' in item.data) props.group = item.data.group; |
|
|
if ('group' in item.data) props.group = item.data.group; |
|
@ -1151,7 +1158,7 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
ItemSet.prototype._onDrag = function (event) { |
|
|
ItemSet.prototype._onDrag = function (event) { |
|
|
event.preventDefault() |
|
|
|
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
if (this.touchParams.itemProps) { |
|
|
if (this.touchParams.itemProps) { |
|
|
var me = this; |
|
|
var me = this; |
|
@ -1174,6 +1181,9 @@ ItemSet.prototype._onDrag = function (event) { |
|
|
var end = new Date(props.end + offset); |
|
|
var end = new Date(props.end + offset); |
|
|
newProps.end = snap ? snap(end) : end; |
|
|
newProps.end = snap ? snap(end) : end; |
|
|
} |
|
|
} |
|
|
|
|
|
else if ('duration' in props) { |
|
|
|
|
|
newProps.end = new Date(newProps.start.valueOf() + props.duration); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ('group' in props) { |
|
|
if ('group' in props) { |
|
|
// drag from one group to another
|
|
|
// drag from one group to another
|
|
|