|
@ -1095,7 +1095,7 @@ ItemSet.prototype._constructByEndArray = function(array) { |
|
|
*/ |
|
|
*/ |
|
|
ItemSet.prototype._onTouch = function (event) { |
|
|
ItemSet.prototype._onTouch = function (event) { |
|
|
// store the touched item, used in _onDragStart
|
|
|
// store the touched item, used in _onDragStart
|
|
|
this.touchParams.item = ItemSet.itemFromTarget(event); |
|
|
|
|
|
|
|
|
this.touchParams.item = this.itemFromTarget(event); |
|
|
this.touchParams.dragLeftItem = event.target.dragLeftItem || false; |
|
|
this.touchParams.dragLeftItem = event.target.dragLeftItem || false; |
|
|
this.touchParams.dragRightItem = event.target.dragRightItem || false; |
|
|
this.touchParams.dragRightItem = event.target.dragRightItem || false; |
|
|
this.touchParams.itemProps = null; |
|
|
this.touchParams.itemProps = null; |
|
@ -1154,7 +1154,7 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
|
|
|
|
|
|
event.stopPropagation(); |
|
|
event.stopPropagation(); |
|
|
} |
|
|
} |
|
|
else if (this.options.editable.add && event.gesture.srcEvent.ctrlKey) { |
|
|
|
|
|
|
|
|
else if (this.options.editable.add && event.srcEvent.ctrlKey) { |
|
|
// create a new range item when dragging with ctrl key down
|
|
|
// create a new range item when dragging with ctrl key down
|
|
|
this._onDragStartAddItem(event); |
|
|
this._onDragStartAddItem(event); |
|
|
} |
|
|
} |
|
@ -1168,7 +1168,7 @@ ItemSet.prototype._onDragStart = function (event) { |
|
|
ItemSet.prototype._onDragStartAddItem = function (event) { |
|
|
ItemSet.prototype._onDragStartAddItem = function (event) { |
|
|
var snap = this.options.snap || null; |
|
|
var snap = this.options.snap || null; |
|
|
var xAbs = util.getAbsoluteLeft(this.dom.frame); |
|
|
var xAbs = util.getAbsoluteLeft(this.dom.frame); |
|
|
var x = event.gesture.center.pageX - xAbs - 10; // minus 10 to compensate for the drag starting as soon as you've moved 10px
|
|
|
|
|
|
|
|
|
var x = event.center.x - xAbs - 10; // minus 10 to compensate for the drag starting as soon as you've moved 10px
|
|
|
var time = this.body.util.toTime(x); |
|
|
var time = this.body.util.toTime(x); |
|
|
var scale = this.body.util.getScale(); |
|
|
var scale = this.body.util.getScale(); |
|
|
var step = this.body.util.getStep(); |
|
|
var step = this.body.util.getStep(); |
|
@ -1198,7 +1198,7 @@ ItemSet.prototype._onDragStartAddItem = function (event) { |
|
|
var props = { |
|
|
var props = { |
|
|
item: newItem, |
|
|
item: newItem, |
|
|
dragRight: true, |
|
|
dragRight: true, |
|
|
initialX: event.gesture.center.pageX, |
|
|
|
|
|
|
|
|
initialX: event.center.x, |
|
|
data: util.extend({}, itemData) |
|
|
data: util.extend({}, itemData) |
|
|
}; |
|
|
}; |
|
|
this.touchParams.itemProps = [props]; |
|
|
this.touchParams.itemProps = [props]; |
|
@ -1579,7 +1579,7 @@ ItemSet.prototype.itemFromTarget = function(event) { |
|
|
* @return {Group | null} group |
|
|
* @return {Group | null} group |
|
|
*/ |
|
|
*/ |
|
|
ItemSet.prototype.groupFromTarget = function(event) { |
|
|
ItemSet.prototype.groupFromTarget = function(event) { |
|
|
var pageY = event.gesture ? event.gesture.center.pageY : event.pageY; |
|
|
|
|
|
|
|
|
var pageY = event.center ? event.center.y : 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]; |
|
|