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