From a98ef0686c8f5adb7d8b76a5c8feaa7cdfdaf9e1 Mon Sep 17 00:00:00 2001 From: jos Date: Mon, 28 Apr 2014 14:53:53 +0200 Subject: [PATCH] Fixed #102: offset in newly created items when using groups. --- HISTORY.md | 1 + src/timeline/Timeline.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 4e73acf8..5a4503aa 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -16,6 +16,7 @@ http://visjs.org Timeline, deselecting selected items). - Fixed initial visible window in case items exceed `zoomMax`. Thanks @Remper. - Option `order` is now deprecated. This was needed for performance improvements. +- Fixed an offset in newly created items when using groups. - Minor bug fixes. - More examples added. diff --git a/src/timeline/Timeline.js b/src/timeline/Timeline.js index 6ba4bb54..eef26894 100644 --- a/src/timeline/Timeline.js +++ b/src/timeline/Timeline.js @@ -639,7 +639,7 @@ Timeline.prototype._onAddItem = function (event) { } else { // add item - var xAbs = vis.util.getAbsoluteLeft(this.rootPanel.frame); + var xAbs = vis.util.getAbsoluteLeft(this.contentPanel.frame); var x = event.gesture.center.pageX - xAbs; var newItem = { start: this.timeAxis.snap(this._toTime(x)),