Skip to content

Commit

Permalink
Fixes visjs#121 - Support for white-space normal in content of range …
Browse files Browse the repository at this point in the history
…items
  • Loading branch information
jasonex7 committed Oct 3, 2019
1 parent 57e091f commit f935763
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/timeline/component/item/RangeItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class RangeItem extends Item {
_getDomComponentsSizes() {
// determine from css whether this box has overflow
this.overflow = window.getComputedStyle(this.dom.frame).overflow !== 'hidden';
this.whiteSpace = window.getComputedStyle(this.dom.content).whiteSpace !== 'nowrap';
return {
content: {
width: this.dom.content.offsetWidth,
Expand Down Expand Up @@ -278,6 +279,9 @@ class RangeItem extends Item {
this.dom.box.style.left = `${this.left}px`;
}
this.dom.box.style.width = `${boxWidth}px`;
if (this.whiteSpace) {
this.height = this.dom.box.offsetHeight;
}

switch (align) {
case 'left':
Expand Down

0 comments on commit f935763

Please sign in to comment.