Browse Source

Fixed #121: Bug in width of items with type `rangeoverflow`

css_transitions
jos 10 years ago
parent
commit
eceb1b0ea4
2 changed files with 9 additions and 4 deletions
  1. +5
    -1
      HISTORY.md
  2. +4
    -3
      src/timeline/component/item/ItemRangeOverflow.js

+ 5
- 1
HISTORY.md View File

@ -4,9 +4,13 @@ http://visjs.org
## not yet released, version 1.0.1 ## not yet released, version 1.0.1
### Timeline
- Fixed width of items with type `rangeoverflow`.
### Graph ### Graph
- added coordinate conversion from DOM to Canvas.
- Added coordinate conversion from DOM to Canvas.
## 2014-05-02, version 1.0.0 ## 2014-05-02, version 1.0.0

+ 4
- 3
src/timeline/component/item/ItemRangeOverflow.js View File

@ -46,9 +46,10 @@ ItemRangeOverflow.prototype.repositionX = function repositionX() {
this.left = start; this.left = start;
var boxWidth = Math.max(end - start, 1); var boxWidth = Math.max(end - start, 1);
this.width = (this.props.content.width < boxWidth) ?
boxWidth :
start + contentLeft + this.props.content.width;
this.width = boxWidth + this.props.content.width;
// Note: The calculation of width is an optimistic calculation, giving
// a width which will not change when moving the Timeline
// So no restacking needed, which is nicer for the eye
this.dom.box.style.left = this.left + 'px'; this.dom.box.style.left = this.left + 'px';
this.dom.box.style.width = boxWidth + 'px'; this.dom.box.style.width = boxWidth + 'px';

Loading…
Cancel
Save