Browse Source

Fixed height of vertical line of box items not always updated correctly

css_transitions
jos 10 years ago
parent
commit
312a73a5a5
2 changed files with 8 additions and 5 deletions
  1. +6
    -4
      src/timeline/component/Group.js
  2. +2
    -1
      src/timeline/component/ItemSet.js

+ 6
- 4
src/timeline/component/Group.js View File

@ -134,10 +134,6 @@ Group.prototype.redraw = function redraw(range, margin, restack) {
else { // no stacking else { // no stacking
stack.nostack(this.visibleItems, margin); stack.nostack(this.visibleItems, margin);
} }
for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {
var item = this.visibleItems[i];
item.repositionY();
}
// recalculate the height of the group // recalculate the height of the group
var height; var height;
@ -171,6 +167,12 @@ Group.prototype.redraw = function redraw(range, margin, restack) {
foreground.style.height = height + 'px'; foreground.style.height = height + 'px';
this.dom.label.style.height = height + 'px'; this.dom.label.style.height = height + 'px';
// update vertical position of items after they are re-stacked and the height of the group is calculated
for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {
var item = this.visibleItems[i];
item.repositionY();
}
return resized; return resized;
}; };

+ 2
- 1
src/timeline/component/ItemSet.js View File

@ -313,7 +313,8 @@ ItemSet.prototype.redraw = function redraw() {
minHeight = margin.axis + margin.item; minHeight = margin.axis + margin.item;
util.forEach(this.groups, function (group) { util.forEach(this.groups, function (group) {
var groupMargin = (group == firstGroup) ? firstMargin : nonFirstMargin; var groupMargin = (group == firstGroup) ? firstMargin : nonFirstMargin;
resized = group.redraw(range, groupMargin, restack) || resized;
var groupResized = group.redraw(range, groupMargin, restack);
resized = groupResized || resized;
height += group.height; height += group.height;
}); });
height = Math.max(height, minHeight); height = Math.max(height, minHeight);

Loading…
Cancel
Save