Browse Source

fix(timeline): #2725 background items positioning when `orientation: top` (#2831)

* Fix background items when orientation top
dependencies
yotamberk 7 years ago
committed by Uli Fahrer
parent
commit
eba3cf82b7
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/timeline/component/item/BackgroundItem.js

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

@ -143,6 +143,7 @@ BackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;
*/ */
BackgroundItem.prototype.repositionY = function(margin) { BackgroundItem.prototype.repositionY = function(margin) {
var height; var height;
var orientation = this.options.orientation.item;
// special positioning for subgroups // special positioning for subgroups
if (this.data.subgroup !== undefined) { if (this.data.subgroup !== undefined) {
@ -154,7 +155,6 @@ BackgroundItem.prototype.repositionY = function(margin) {
this.dom.box.style.height = this.parent.subgroups[itemSubgroup].height + 'px'; this.dom.box.style.height = this.parent.subgroups[itemSubgroup].height + 'px';
var orientation = this.options.orientation.item;
if (orientation == 'top') { if (orientation == 'top') {
this.dom.box.style.top = this.parent.top + this.parent.subgroups[itemSubgroup].top + 'px'; this.dom.box.style.top = this.parent.top + this.parent.subgroups[itemSubgroup].top + 'px';
} else { } else {
@ -170,8 +170,8 @@ BackgroundItem.prototype.repositionY = function(margin) {
height = Math.max(this.parent.height, height = Math.max(this.parent.height,
this.parent.itemSet.body.domProps.center.height, this.parent.itemSet.body.domProps.center.height,
this.parent.itemSet.body.domProps.centerContainer.height); this.parent.itemSet.body.domProps.centerContainer.height);
this.dom.box.style.bottom = orientation == 'bottom' ? '0' : '';
this.dom.box.style.top = orientation == 'top' ? '0' : ''; this.dom.box.style.top = orientation == 'top' ? '0' : '';
this.dom.box.style.bottom = orientation == 'top' ? '' : '0';
} }
else { else {
height = this.parent.height; height = this.parent.height;

Loading…
Cancel
Save