From e3f8e33ef90afcfe5abd1f455122a20e5e7d50c0 Mon Sep 17 00:00:00 2001 From: windy Date: Thu, 27 Oct 2022 16:26:26 +0800 Subject: [PATCH] =?UTF-8?q?BI-116192=20=E5=8A=A8=E6=80=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8D=E5=8F=AF=E8=A7=81=E7=8A=B6=E6=80=81=E4=B8=8B?= =?UTF-8?q?resize=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/listview.js | 3 +++ src/base/list/virtualgrouplist.js | 4 +++- src/base/list/virtuallist.js | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index 7028132bc..c998281b9 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -55,6 +55,9 @@ BI.ListView = BI.inherit(BI.Widget, { var lastWidth = this.element.width(), lastHeight = this.element.height(); BI.ResizeDetector.addResizeListener(this, function () { + if (!self.element.is(":visible")) { + return; + } var width = self.element.width(), height = self.element.height(); if (width !== lastWidth || height !== lastHeight) { diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index 34b11e800..2db1e0765 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -74,7 +74,9 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { } }); BI.ResizeDetector.addResizeListener(this, function () { - self._calculateBlocksToRender(); + if (self.element.is(":visible")) { + self._calculateBlocksToRender(); + } }); }, diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index 2715008cb..011d53344 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -61,7 +61,9 @@ BI.VirtualList = BI.inherit(BI.Widget, { self._calculateBlocksToRender(); }); BI.ResizeDetector.addResizeListener(this, function () { - self._calculateBlocksToRender(); + if (self.element.is(":visible")) { + self._calculateBlocksToRender(); + } }); },