From e953ba4c3cd35a6d94fb8b2076b80399be0b6b14 Mon Sep 17 00:00:00 2001 From: jos Date: Mon, 27 Oct 2014 12:38:00 +0100 Subject: [PATCH 1/2] Updated history --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index c54eee9d..d1ac64a1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,7 @@ http://visjs.org ### Timeline - Fixed background items not always be cleared when removing them. +- Fixed visible items not always be displayed. ## 2014-10-24, version 3.6.2 From cc58bcadab881b8930abf7d90a91801f3a732e2a Mon Sep 17 00:00:00 2001 From: jos Date: Mon, 27 Oct 2014 12:46:51 +0100 Subject: [PATCH 2/2] Little refactoring --- lib/timeline/component/ItemSet.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index ac0da122..f9d32abd 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -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) :