Skip to content

Commit

Permalink
fix: check for showStipes option when getting DOM sizes in ClusterItem (
Browse files Browse the repository at this point in the history
#374)

Co-authored-by: Yotam Berkowitz <[email protected]>
  • Loading branch information
bhml and yotamberk authored Mar 14, 2020
1 parent 8163771 commit 469ab8a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/timeline/component/item/ClusterItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,23 +533,28 @@ class ClusterItem extends Item {
* @return {object}
*/
_getDomComponentsSizes() {
return {
const sizes = {
previous: {
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
},
};

if (this.options.showStipes) {
sizes.dot = {
height: this.dom.dot.offsetHeight,
width: this.dom.dot.offsetWidth
};
sizes.line = {
width: this.dom.line.offsetWidth
};
}

return sizes;
}

/**
Expand Down

0 comments on commit 469ab8a

Please sign in to comment.