Skip to content

Commit

Permalink
fix: showStipes not working (#266) (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamberk authored Feb 1, 2020
1 parent 938dc1a commit ca9b018
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/timeline/component/item/ClusterItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ class ClusterItem extends Item {
const lineOffsetDirection = this.options.rtl ? lineOffset * -1 : lineOffset;
const dotOffsetDirection = this.options.rtl ? dotOffset * -1 : dotOffset;

this.dom.line.style.transform = `translateX(${lineOffsetDirection})px`;
this.dom.line.style.transform = `translateX(${lineOffsetDirection}px)`;
this.dom.dot.style.transform = `translateX(${dotOffsetDirection}px)`;
} else {
const lineOffsetDirection = this.options.rtl ? start * -1 : start;
const dotOffsetDirection = this.options.rtl ? (start - dotOffsetWidth / 2) * -1 : start - dotOffsetWidth / 2;
const lineOffsetDirection = this.options.rtl ? (start * -1) : start;
const dotOffsetDirection = this.options.rtl ? ((start - dotOffsetWidth / 2) * -1) : (start - dotOffsetWidth / 2);

this.dom.line.style.transform = `${lineOffsetDirection}px`;
this.dom.dot.style.transform = `${dotOffsetDirection}px`;
this.dom.line.style.transform = `translateX(${lineOffsetDirection}px)`;
this.dom.dot.style.transform = `translateX(${dotOffsetDirection}px)`;
}
}

Expand Down Expand Up @@ -538,6 +538,13 @@ class ClusterItem extends Item {
right: this.dom.box.style.right,
left: this.dom.box.style.left
},
dot: {
height: this.dom.dot.offsetHeight,
width: this.dom.dot.offsetWidth
},
line: {
width: this.dom.line.offsetWidth
},
box: {
width: this.dom.box.offsetWidth,
height: this.dom.box.offsetHeight
Expand Down

0 comments on commit ca9b018

Please sign in to comment.