From 3ff331c22b29a477404574fa7e388e6f507e577e Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 31 Aug 2020 14:06:18 -0600 Subject: [PATCH] Etemplate: Avoid trying to repaint datagrid while it's hidden Avoids an infinite(?) loop and endless "[Violation] 'setTimeout' handler took ms" messages --- api/js/etemplate/et2_dataview_view_grid.js | 4 ++++ api/js/etemplate/et2_dataview_view_grid.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/api/js/etemplate/et2_dataview_view_grid.js b/api/js/etemplate/et2_dataview_view_grid.js index 9f5457b3d0..1fdad47d5e 100644 --- a/api/js/etemplate/et2_dataview_view_grid.js +++ b/api/js/etemplate/et2_dataview_view_grid.js @@ -643,6 +643,10 @@ var et2_dataview_grid = /** @class */ (function (_super_1) { et2_dataview_grid.prototype._doInvalidate = function (_super) { if (!this.doInvalidate) return; + // Not visible? + if (jQuery(":visible", this.outerCell).length == 0) { + return; + } // Update the pixel positions this._recalculateElementPosition(); // Call the callback diff --git a/api/js/etemplate/et2_dataview_view_grid.ts b/api/js/etemplate/et2_dataview_view_grid.ts index efb22c6149..efc7630678 100644 --- a/api/js/etemplate/et2_dataview_view_grid.ts +++ b/api/js/etemplate/et2_dataview_view_grid.ts @@ -893,6 +893,11 @@ export class et2_dataview_grid extends et2_dataview_container implements et2_dat { if(!this.doInvalidate) return; + // Not visible? + if(jQuery(":visible",this.outerCell).length == 0) + { + return; + } // Update the pixel positions this._recalculateElementPosition();