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