Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Commit eba3cf8

Browse files
yotamberkTooa
authored andcommitted
fix(timeline): #2725 background items positioning when orientation: top (#2831)
* Fix background items when orientation top
1 parent 88807e4 commit eba3cf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/timeline/component/item/BackgroundItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ BackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;
143143
*/
144144
BackgroundItem.prototype.repositionY = function(margin) {
145145
var height;
146+
var orientation = this.options.orientation.item;
146147

147148
// special positioning for subgroups
148149
if (this.data.subgroup !== undefined) {
@@ -154,7 +155,6 @@ BackgroundItem.prototype.repositionY = function(margin) {
154155

155156
this.dom.box.style.height = this.parent.subgroups[itemSubgroup].height + 'px';
156157

157-
var orientation = this.options.orientation.item;
158158
if (orientation == 'top') {
159159
this.dom.box.style.top = this.parent.top + this.parent.subgroups[itemSubgroup].top + 'px';
160160
} else {
@@ -170,8 +170,8 @@ BackgroundItem.prototype.repositionY = function(margin) {
170170
height = Math.max(this.parent.height,
171171
this.parent.itemSet.body.domProps.center.height,
172172
this.parent.itemSet.body.domProps.centerContainer.height);
173+
this.dom.box.style.bottom = orientation == 'bottom' ? '0' : '';
173174
this.dom.box.style.top = orientation == 'top' ? '0' : '';
174-
this.dom.box.style.bottom = orientation == 'top' ? '' : '0';
175175
}
176176
else {
177177
height = this.parent.height;

0 commit comments

Comments
 (0)