diff --git a/lib/timeline/component/item/BoxItem.js b/lib/timeline/component/item/BoxItem.js index 4aee6f7f..ba2d258a 100644 --- a/lib/timeline/component/item/BoxItem.js +++ b/lib/timeline/component/item/BoxItem.js @@ -110,19 +110,29 @@ BoxItem.prototype.redraw = function() { this._updateDataAttributes(this.dom.box); this._updateStyle(this.dom.box); - var editable = (this.options.editable.updateTime || + var editable = (this.options.editable.updateTime || this.options.editable.updateGroup || this.editable === true) && this.editable !== false; // update class var className = (this.data.className? ' ' + this.data.className : '') + - (this.selected ? ' vis-selected' : '') + + (this.selected ? ' vis-selected' : '') + (editable ? ' vis-editable' : ' vis-readonly'); dom.box.className = 'vis-item vis-box' + className; dom.line.className = 'vis-item vis-line' + className; dom.dot.className = 'vis-item vis-dot' + className; + // set initial position in the visible range of the grid so that the + // rendered box size can be determinated correctly, even the content + // has a dynamic width (fixes #2032). + // The correct position is reset by this.repositionX + if (this.options.rtl) { + dom.box.style.right = "0px"; + } else { + dom.box.style.left = "0px"; + } + // recalculate size this.props.dot.height = dom.dot.offsetHeight; this.props.dot.width = dom.dot.offsetWidth;