From 2d8604b8ee7dcd388546fb0899de23a71732d6dd Mon Sep 17 00:00:00 2001 From: jos Date: Mon, 20 Apr 2015 10:46:43 +0200 Subject: [PATCH] Some fixes in Timeline after merging develop --- lib/timeline/component/ItemSet.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 96bddac5..9be1e4ab 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1095,7 +1095,7 @@ ItemSet.prototype._constructByEndArray = function(array) { */ ItemSet.prototype._onTouch = function (event) { // 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.dragRightItem = event.target.dragRightItem || false; this.touchParams.itemProps = null; @@ -1154,7 +1154,7 @@ ItemSet.prototype._onDragStart = function (event) { 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 this._onDragStartAddItem(event); } @@ -1168,7 +1168,7 @@ ItemSet.prototype._onDragStart = function (event) { ItemSet.prototype._onDragStartAddItem = function (event) { var snap = this.options.snap || null; 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 scale = this.body.util.getScale(); var step = this.body.util.getStep(); @@ -1198,7 +1198,7 @@ ItemSet.prototype._onDragStartAddItem = function (event) { var props = { item: newItem, dragRight: true, - initialX: event.gesture.center.pageX, + initialX: event.center.x, data: util.extend({}, itemData) }; this.touchParams.itemProps = [props]; @@ -1579,7 +1579,7 @@ ItemSet.prototype.itemFromTarget = function(event) { * @return {Group | null} group */ 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++) { var groupId = this.groupIds[i]; var group = this.groups[groupId];