From 6539ca74ed149d5d9695f64b61831d23f02908c9 Mon Sep 17 00:00:00 2001 From: Iskander508 Date: Tue, 20 Sep 2016 09:16:19 +0200 Subject: [PATCH] Fixed position of box item (#2106) * fixes #2064 --- lib/timeline/component/item/BoxItem.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/timeline/component/item/BoxItem.js b/lib/timeline/component/item/BoxItem.js index ba2d258a..4a6d5e9e 100644 --- a/lib/timeline/component/item/BoxItem.js +++ b/lib/timeline/component/item/BoxItem.js @@ -126,7 +126,8 @@ BoxItem.prototype.redraw = function() { // 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 + var previousRight = dom.box.style.right; + var previousLeft = dom.box.style.left; if (this.options.rtl) { dom.box.style.right = "0px"; } else { @@ -140,6 +141,13 @@ BoxItem.prototype.redraw = function() { this.width = dom.box.offsetWidth; this.height = dom.box.offsetHeight; + // restore previous position + if (this.options.rtl) { + dom.box.style.right = previousRight; + } else { + dom.box.style.left = previousLeft; + } + this.dirty = false; }