Browse Source

Fixed position of box item (#2106)

* fixes #2064
codeClimate
Iskander508 8 years ago
committed by Alexander Wunschik
parent
commit
6539ca74ed
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      lib/timeline/component/item/BoxItem.js

+ 9
- 1
lib/timeline/component/item/BoxItem.js View File

@ -126,7 +126,8 @@ BoxItem.prototype.redraw = function() {
// set initial position in the visible range of the grid so that the // set initial position in the visible range of the grid so that the
// rendered box size can be determinated correctly, even the content // rendered box size can be determinated correctly, even the content
// has a dynamic width (fixes #2032). // 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) { if (this.options.rtl) {
dom.box.style.right = "0px"; dom.box.style.right = "0px";
} else { } else {
@ -140,6 +141,13 @@ BoxItem.prototype.redraw = function() {
this.width = dom.box.offsetWidth; this.width = dom.box.offsetWidth;
this.height = dom.box.offsetHeight; 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; this.dirty = false;
} }

Loading…
Cancel
Save