From 3fdb024ff2233890f5f573f2601870d3f5e6d3dd Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 9 Jan 2014 16:46:39 +0000 Subject: [PATCH] Don't reset height until it's time to invalidate, avoids re-calculating on every row --- etemplate/js/et2_dataview_view_grid.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_dataview_view_grid.js b/etemplate/js/et2_dataview_view_grid.js index 97500b618c..3b2226b566 100644 --- a/etemplate/js/et2_dataview_view_grid.js +++ b/etemplate/js/et2_dataview_view_grid.js @@ -476,9 +476,6 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, * changes. */ invalidate: function() { - // Clear the "_avgHeight" - this._avgHeight = false; - this._avgCount = false; // Clear any existing "invalidate" timeout if (this._invalidateTimeout) @@ -489,6 +486,9 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, var self = this; var _super = this._super; this._invalidateTimeout = window.setTimeout(function() { + // Clear the "_avgHeight" + self._avgHeight = false; + self._avgCount = false; self._invalidateTimeout = null; self._doInvalidate(_super); }, ET2_GRID_INVALIDATE_TIMEOUT);