Browse Source

Fixes #2307 timeline async initial redraw bug (#2386)

codeClimate
yotamberk 8 years ago
committed by Alexander Wunschik
parent
commit
a32a7f77f3
2 changed files with 5 additions and 12 deletions
  1. +4
    -12
      lib/timeline/Core.js
  2. +1
    -0
      lib/timeline/component/ItemSet.js

+ 4
- 12
lib/timeline/Core.js View File

@ -116,18 +116,10 @@ Core.prototype._create = function (container) {
var me = this; var me = this;
this.on('_change', function (properties) { this.on('_change', function (properties) {
if (properties && properties.queue == true) {
// redraw once on next tick
if (!me._redrawTimer) {
me._redrawTimer = setTimeout(function () {
me._redrawTimer = null;
me._redraw();
}, 0)
}
}
else {
// redraw immediately
me._redraw();
if (me.itemSet.initialItemSetDrawn && properties && properties.queue == true) {
me._redraw()
} else {
me._origRedraw();
} }
}); });

+ 1
- 0
lib/timeline/component/ItemSet.js View File

@ -648,6 +648,7 @@ ItemSet.prototype.redraw = function() {
this.dom.axis.style.left = '0'; this.dom.axis.style.left = '0';
} }
this.initialItemSetDrawn = true;
// check if this component is resized // check if this component is resized
resized = this._isResized() || resized; resized = this._isResized() || resized;

Loading…
Cancel
Save