From dcb2d586162b66f980a62f1a005212a9fef9204d Mon Sep 17 00:00:00 2001 From: Yotam Berkowitz Date: Fri, 2 Dec 2016 22:23:05 +0200 Subject: [PATCH] Fix redraw order --- lib/timeline/Core.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/timeline/Core.js b/lib/timeline/Core.js index 1eeb0faa..aa8344da 100644 --- a/lib/timeline/Core.js +++ b/lib/timeline/Core.js @@ -115,6 +115,10 @@ Core.prototype._create = function (container) { this.on('panmove', this._onDrag.bind(this)); var me = this; + + this._origRedraw = this._redraw.bind(this); + this._redraw = util.throttle(this._origRedraw); + this.on('_change', function (properties) { if (me.itemSet.initialItemSetDrawn && properties && properties.queue == true) { me._redraw() @@ -412,15 +416,7 @@ Core.prototype.setOptions = function (options) { this.configurator.setModuleOptions({global: appliedOptions}); } - // override redraw with a throttled version - if (!this._origRedraw) { - this._origRedraw = this._redraw.bind(this); - this._redraw = util.throttle(this._origRedraw); - } else { - // Not the initial run: redraw everything - this._redraw(); - } - + this._redraw(); }; /**