Browse Source

Little refactoring

v3_develop
jos 10 years ago
parent
commit
cc58bcadab
1 changed files with 13 additions and 14 deletions
  1. +13
    -14
      lib/timeline/component/ItemSet.js

+ 13
- 14
lib/timeline/component/ItemSet.js View File

@ -503,22 +503,23 @@ ItemSet.prototype.redraw = function() {
this.lastVisibleInterval = visibleInterval;
this.props.lastWidth = this.props.width;
var restack = this.stackDirty;
var firstGroup = this._firstGroup();
var firstMargin = {
item: margin.item,
axis: margin.axis
};
var nonFirstMargin = {
item: margin.item,
axis: margin.item.vertical / 2
};
var height = 0;
var minHeight = margin.axis + margin.item.vertical;
// redraw the background group
this.groups[BACKGROUND].redraw(range, nonFirstMargin, restack);
// redraw all regular groups
var restack = this.stackDirty,
firstGroup = this._firstGroup(),
firstMargin = {
item: margin.item,
axis: margin.axis
},
nonFirstMargin = {
item: margin.item,
axis: margin.item.vertical / 2
},
height = 0,
minHeight = margin.axis + margin.item.vertical;
util.forEach(this.groups, function (group) {
var groupMargin = (group == firstGroup) ? firstMargin : nonFirstMargin;
var groupResized = group.redraw(range, groupMargin, restack);
@ -535,8 +536,6 @@ ItemSet.prototype.redraw = function() {
this.props.width = frame.offsetWidth;
this.props.height = height;
// reposition axis
// reposition axis
this.dom.axis.style.top = asSize((orientation == 'top') ?
(this.body.domProps.top.height + this.body.domProps.border.top) :

Loading…
Cancel
Save