From ca9b01883c4515dd235221a8f333a258503c4642 Mon Sep 17 00:00:00 2001 From: Yotam Berkowitz Date: Sat, 1 Feb 2020 19:12:26 +0200 Subject: [PATCH] fix: showStipes not working (#266) (#276) --- lib/timeline/component/item/ClusterItem.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/timeline/component/item/ClusterItem.js b/lib/timeline/component/item/ClusterItem.js index 1eaef959eb..5c65454c94 100644 --- a/lib/timeline/component/item/ClusterItem.js +++ b/lib/timeline/component/item/ClusterItem.js @@ -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)`; } } @@ -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