diff --git a/lib/timeline/component/item/BackgroundItem.js b/lib/timeline/component/item/BackgroundItem.js index f0255415..a4ec1bd9 100644 --- a/lib/timeline/component/item/BackgroundItem.js +++ b/lib/timeline/component/item/BackgroundItem.js @@ -143,6 +143,7 @@ BackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX; */ BackgroundItem.prototype.repositionY = function(margin) { var height; + var orientation = this.options.orientation.item; // special positioning for subgroups 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'; - var orientation = this.options.orientation.item; if (orientation == 'top') { this.dom.box.style.top = this.parent.top + this.parent.subgroups[itemSubgroup].top + 'px'; } else { @@ -170,8 +170,8 @@ BackgroundItem.prototype.repositionY = function(margin) { height = Math.max(this.parent.height, this.parent.itemSet.body.domProps.center.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.bottom = orientation == 'top' ? '' : '0'; } else { height = this.parent.height;