|
|
@ -1115,7 +1115,7 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
|
if (dragLeftItem) { |
|
|
|
props = { |
|
|
|
item: dragLeftItem, |
|
|
|
initialX: event.gesture.center.clientX |
|
|
|
initialX: event.gesture.center.pageX |
|
|
|
}; |
|
|
|
|
|
|
|
if (me.options.editable.updateTime) { |
|
|
@ -1130,7 +1130,7 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
|
else if (dragRightItem) { |
|
|
|
props = { |
|
|
|
item: dragRightItem, |
|
|
|
initialX: event.gesture.center.clientX |
|
|
|
initialX: event.gesture.center.pageX |
|
|
|
}; |
|
|
|
|
|
|
|
if (me.options.editable.updateTime) { |
|
|
@ -1147,7 +1147,7 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
|
var item = me.items[id]; |
|
|
|
var props = { |
|
|
|
item: item, |
|
|
|
initialX: event.gesture.center.clientX |
|
|
|
initialX: event.gesture.center.pageX |
|
|
|
}; |
|
|
|
|
|
|
|
if (me.options.editable.updateTime) { |
|
|
@ -1214,7 +1214,7 @@ ItemSet.prototype._onDragStartAddItem = function (event) { |
|
|
|
var props = { |
|
|
|
item: newItem, |
|
|
|
end: end.valueOf(), |
|
|
|
initialX: event.gesture.center.clientX |
|
|
|
initialX: event.gesture.center.pageX |
|
|
|
}; |
|
|
|
this.touchParams.itemProps = [props]; |
|
|
|
|
|
|
@ -1241,7 +1241,7 @@ ItemSet.prototype._onDrag = function (event) { |
|
|
|
// move
|
|
|
|
this.touchParams.itemProps.forEach(function (props) { |
|
|
|
var newProps = {}; |
|
|
|
var current = me.body.util.toTime(event.gesture.center.clientX - xOffset); |
|
|
|
var current = me.body.util.toTime(event.gesture.center.pageX - xOffset); |
|
|
|
var initial = me.body.util.toTime(props.initialX - xOffset); |
|
|
|
var offset = current - initial; |
|
|
|
|
|
|
@ -1607,23 +1607,23 @@ ItemSet.prototype.itemFromTarget = function(event) { |
|
|
|
* @return {Group | null} group |
|
|
|
*/ |
|
|
|
ItemSet.prototype.groupFromTarget = function(event) { |
|
|
|
var clientY = event.gesture ? event.gesture.center.clientY : event.clientY; |
|
|
|
var pageY = event.gesture ? event.gesture.center.pageY : event.pageY; |
|
|
|
for (var i = 0; i < this.groupIds.length; i++) { |
|
|
|
var groupId = this.groupIds[i]; |
|
|
|
var group = this.groups[groupId]; |
|
|
|
var foreground = group.dom.foreground; |
|
|
|
var top = util.getAbsoluteTop(foreground); |
|
|
|
if (clientY > top && clientY < top + foreground.offsetHeight) { |
|
|
|
if (pageY > top && pageY < top + foreground.offsetHeight) { |
|
|
|
return group; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.options.orientation === 'top') { |
|
|
|
if (i === this.groupIds.length - 1 && clientY > top) { |
|
|
|
if (i === this.groupIds.length - 1 && pageY > top) { |
|
|
|
return group; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
if (i === 0 && clientY < top + foreground.offset) { |
|
|
|
if (i === 0 && pageY < top + foreground.offset) { |
|
|
|
return group; |
|
|
|
} |
|
|
|
} |
|
|
|