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