From f570fed5c1880fc4740d63018b65dee65ac8da0a Mon Sep 17 00:00:00 2001 From: Yotam Berkowitz Date: Thu, 21 Sep 2017 15:06:19 +0300 Subject: [PATCH] Fix Group Performance (#3453) * Implement group redraw @grimalschi performance enhancement * Fix JSDoc for redraw * Remove commented out in itemset * Remove fasdom * Clean up queue functions in group redraw * Fix mistake in comments * Remove extra read-write from _didResize * Resolve review comments * Fix ranged item resizing bug * remove parameter that wasn;t used --- lib/timeline/component/Group.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index 6a26b27b..9d2301e6 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -285,7 +285,7 @@ Group.prototype._applyGroupHeight = function(height) { } // update vertical position of items after they are re-stacked and the height of the group is calculated -Group.prototype._updateItemsVerticalPosition = function(resized, margin) { +Group.prototype._updateItemsVerticalPosition = function(margin) { for (var i = 0, ii = this.visibleItems.length; i < ii; i++) { var item = this.visibleItems[i]; item.repositionY(margin); @@ -293,12 +293,6 @@ Group.prototype._updateItemsVerticalPosition = function(resized, margin) { if (item.displayed) item.hide(); } } - - if (!this.isVisible && this.height) { - return false; - } - - return resized; } /** @@ -360,8 +354,15 @@ Group.prototype.redraw = function(range, margin, forceRestack, returnQueue) { // update vertical position of items after they are re-stacked and the height of the group is calculated (function() { - return resized = this._updateItemsVerticalPosition.bind(this)(resized, margin) - }).bind(this) + this._updateItemsVerticalPosition.bind(this)(margin) + }).bind(this), + + function() { + if (!this.isVisible && this.height) { + resized = false; + } + return resized + } ] if (returnQueue) {