|
|
@ -1100,17 +1100,18 @@ ItemSet.prototype._onDrag = function (event) { |
|
|
|
if (this.touchParams.itemProps) { |
|
|
|
var me = this; |
|
|
|
var snap = this.body.util.snap || null; |
|
|
|
var xOffset = this.body.dom.root.offsetLeft + this.body.domProps.left.width; |
|
|
|
|
|
|
|
// move
|
|
|
|
this.touchParams.itemProps.forEach(function (props) { |
|
|
|
var newProps = {}; |
|
|
|
if ('start' in props && !('end' in props)) { // only start in props
|
|
|
|
var start = me.body.util.toTime(event.gesture.center.clientX) |
|
|
|
var start = me.body.util.toTime(event.gesture.center.clientX - xOffset); |
|
|
|
newProps.start = snap ? snap(start) : start; |
|
|
|
} |
|
|
|
else if ('start' in props) { // start and end in props
|
|
|
|
var current = me.body.util.toTime(event.gesture.center.clientX); |
|
|
|
var initial = me.body.util.toTime(props.initialX); |
|
|
|
var current = me.body.util.toTime(event.gesture.center.clientX - xOffset); |
|
|
|
var initial = me.body.util.toTime(props.initialX - xOffset); |
|
|
|
var offset = current - initial; |
|
|
|
var start = new Date(props.start + offset); |
|
|
|
var end = new Date(props.end + offset); |
|
|
@ -1119,7 +1120,7 @@ ItemSet.prototype._onDrag = function (event) { |
|
|
|
newProps.end = snap ? snap(end) : end; |
|
|
|
} |
|
|
|
else if ('end' in props) { // only end in props
|
|
|
|
var end = me.body.util.toTime(event.gesture.center.clientX); |
|
|
|
var end = me.body.util.toTime(event.gesture.center.clientX - xOffset); |
|
|
|
newProps.end = snap ? snap(end) : end; |
|
|
|
} |
|
|
|
|
|
|
|