From 7459d14da70ad4fe25acdae68ba231be8ae910e7 Mon Sep 17 00:00:00 2001 From: Fay Date: Tue, 24 Sep 2019 16:06:33 +0800 Subject: [PATCH] =?UTF-8?q?BI-52376=20resize=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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index ae8c5b48c6..30d635018f 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -45,8 +45,16 @@ BI.ListView = BI.inherit(BI.Widget, { o.scrollTop = self.element.scrollTop(); self._calculateBlocksToRender(); }); + var lastWidth = this.element.width(), + lastHeight = this.element.height(); BI.ResizeDetector.addResizeListener(this, function () { - self._calculateBlocksToRender(); + var width = self.element.width(), + height = self.element.height(); + if (width !== lastWidth || height !== lastHeight) { + self._calculateBlocksToRender(); + lastWidth = width; + lastHeight = height; + } }); },