Browse Source

Fixed height of BackgroundItems not being 100% when timeline has a fixed height

v3_develop
jos 10 years ago
parent
commit
ace17d4f21
12 changed files with 25283 additions and 25290 deletions
  1. +5
    -0
      HISTORY.md
  2. +3
    -9
      dist/vis.css
  3. +25246
    -25257
      dist/vis.js
  4. +1
    -1
      dist/vis.map
  5. +1
    -1
      dist/vis.min.css
  6. +14
    -14
      dist/vis.min.js
  7. +0
    -2
      lib/timeline/component/css/item.css
  8. +1
    -0
      lib/timeline/component/css/itemset.css
  9. +7
    -1
      lib/timeline/component/item/BackgroundItem.js
  10. +3
    -3
      lib/timeline/component/item/BoxItem.js
  11. +1
    -1
      lib/timeline/component/item/PointItem.js
  12. +1
    -1
      lib/timeline/component/item/RangeItem.js

+ 5
- 0
HISTORY.md View File

@ -14,6 +14,11 @@ http://visjs.org
- Fixed cluster fontsize scaling. - Fixed cluster fontsize scaling.
- Fixed cluster sector scaling. - Fixed cluster sector scaling.
### Timeline
- Fixed height of BackgroundItems not being 100% when timeline has a fixed height.
- Fixed width of BackgroundItems not being reduced to 0 when zooming out.
### DataSet ### DataSet
- Event listeners of `update` now receive an extra property `data`, - Event listeners of `update` now receive an extra property `data`,

+ 3
- 9
dist/vis.css View File

@ -138,6 +138,7 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: visible;
} }
.vis.timeline .axis { .vis.timeline .axis {
@ -214,8 +215,8 @@
border: none; border: none;
background-color: rgba(213, 221, 246, 0.4); background-color: rgba(213, 221, 246, 0.4);
box-sizing: border-box; box-sizing: border-box;
top: 0;
bottom: 0;
padding: 0;
margin: 0;
} }
.vis.timeline .item.range .content { .vis.timeline .item.range .content {
@ -232,13 +233,6 @@
max-width: 100%; max-width: 100%;
margin: 5px; margin: 5px;
} }
.vis.timeline .item.background .noContent {
position: absolute;
display: inline-block;
overflow: hidden;
max-width: 100%;
margin: 0px;
}
.vis.timeline .item.line { .vis.timeline .item.line {
padding: 0; padding: 0;

+ 25246
- 25257
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.min.css
File diff suppressed because it is too large
View File


+ 14
- 14
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 0
- 2
lib/timeline/component/css/item.css View File

@ -56,8 +56,6 @@
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
margin: 0; margin: 0;
top: 0;
bottom: 0;
} }
.vis.timeline .item.range .content { .vis.timeline .item.range .content {

+ 1
- 0
lib/timeline/component/css/itemset.css View File

@ -12,6 +12,7 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: visible;
} }
.vis.timeline .axis { .vis.timeline .axis {

+ 7
- 1
lib/timeline/component/item/BackgroundItem.js View File

@ -81,7 +81,7 @@ BackgroundItem.prototype.redraw = function() {
if (!dom.box.parentNode) { if (!dom.box.parentNode) {
var background = this.parent.dom.background; var background = this.parent.dom.background;
if (!background) { if (!background) {
throw new Error('Cannot redraw time axis: parent has no background container element');
throw new Error('Cannot redraw item: parent has no background container element');
} }
background.appendChild(dom.box); background.appendChild(dom.box);
} }
@ -138,6 +138,12 @@ BackgroundItem.prototype.repositionY = function() {
var onTop = this.options.orientation === 'top'; var onTop = this.options.orientation === 'top';
this.dom.content.style.top = onTop ? '' : '0'; this.dom.content.style.top = onTop ? '' : '0';
this.dom.content.style.bottom = onTop ? '0' : ''; this.dom.content.style.bottom = onTop ? '0' : '';
var height = Math.max(this.parent.height,
this.parent.itemSet.body.domProps.centerContainer.height);
this.dom.box.style.top = onTop ? '0' : '';
this.dom.box.style.bottom = onTop ? '' : '0';
this.dom.box.style.height = height + 'px';
}; };
module.exports = BackgroundItem; module.exports = BackgroundItem;

+ 3
- 3
lib/timeline/component/item/BoxItem.js View File

@ -84,17 +84,17 @@ BoxItem.prototype.redraw = function() {
} }
if (!dom.box.parentNode) { if (!dom.box.parentNode) {
var foreground = this.parent.dom.foreground; var foreground = this.parent.dom.foreground;
if (!foreground) throw new Error('Cannot redraw time axis: parent has no foreground container element');
if (!foreground) throw new Error('Cannot redraw item: parent has no foreground container element');
foreground.appendChild(dom.box); foreground.appendChild(dom.box);
} }
if (!dom.line.parentNode) { if (!dom.line.parentNode) {
var background = this.parent.dom.background; var background = this.parent.dom.background;
if (!background) throw new Error('Cannot redraw time axis: parent has no background container element');
if (!background) throw new Error('Cannot redraw item: parent has no background container element');
background.appendChild(dom.line); background.appendChild(dom.line);
} }
if (!dom.dot.parentNode) { if (!dom.dot.parentNode) {
var axis = this.parent.dom.axis; var axis = this.parent.dom.axis;
if (!background) throw new Error('Cannot redraw time axis: parent has no axis container element');
if (!background) throw new Error('Cannot redraw item: parent has no axis container element');
axis.appendChild(dom.dot); axis.appendChild(dom.dot);
} }
this.displayed = true; this.displayed = true;

+ 1
- 1
lib/timeline/component/item/PointItem.js View File

@ -83,7 +83,7 @@ PointItem.prototype.redraw = function() {
if (!dom.point.parentNode) { if (!dom.point.parentNode) {
var foreground = this.parent.dom.foreground; var foreground = this.parent.dom.foreground;
if (!foreground) { if (!foreground) {
throw new Error('Cannot redraw time axis: parent has no foreground container element');
throw new Error('Cannot redraw item: parent has no foreground container element');
} }
foreground.appendChild(dom.point); foreground.appendChild(dom.point);
} }

+ 1
- 1
lib/timeline/component/item/RangeItem.js View File

@ -78,7 +78,7 @@ RangeItem.prototype.redraw = function() {
if (!dom.box.parentNode) { if (!dom.box.parentNode) {
var foreground = this.parent.dom.foreground; var foreground = this.parent.dom.foreground;
if (!foreground) { if (!foreground) {
throw new Error('Cannot redraw time axis: parent has no foreground container element');
throw new Error('Cannot redraw item: parent has no foreground container element');
} }
foreground.appendChild(dom.box); foreground.appendChild(dom.box);
} }

Loading…
Cancel
Save