From 8f352edb5332d36fdf6c42853646600ec647cabf Mon Sep 17 00:00:00 2001 From: jos Date: Tue, 29 Apr 2014 14:36:02 +0200 Subject: [PATCH] Moved function getLabelsWidth --- src/timeline/Timeline.js | 1 - src/timeline/component/ItemSet.js | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/timeline/Timeline.js b/src/timeline/Timeline.js index ebea8ddc..9c4fda08 100644 --- a/src/timeline/Timeline.js +++ b/src/timeline/Timeline.js @@ -436,7 +436,6 @@ Timeline.prototype.setItems = function(items) { */ Timeline.prototype.setGroups = function(groupSet) { this.groupsData = groupSet; - this.itemSet.setGroups(groupSet); }; diff --git a/src/timeline/component/ItemSet.js b/src/timeline/component/ItemSet.js index 5f77fcdc..d42c8f3a 100644 --- a/src/timeline/component/ItemSet.js +++ b/src/timeline/component/ItemSet.js @@ -19,6 +19,11 @@ function ItemSet(backgroundPanel, axisPanel, options) { this.axisPanel = axisPanel; this.itemOptions = Object.create(this.options); this.dom = {}; + this.props = { + labels: { + width: 0 + } + }; this.hammer = null; var me = this; @@ -698,6 +703,14 @@ ItemSet.prototype._constructByEndArray = function _constructByEndArray(array) { return endArray; }; +/** + * Get the width of the group labels + * @return {Number} width + */ +ItemSet.prototype.getLabelsWidth = function getLabelsWidth() { + return this.props.labels.width; +}; + /** * Start dragging the selected events * @param {Event} event