From 7459d14da70ad4fe25acdae68ba231be8ae910e7 Mon Sep 17 00:00:00 2001 From: Fay Date: Tue, 24 Sep 2019 16:06:33 +0800 Subject: [PATCH 1/2] =?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; + } }); }, From 19463fb2b08eed7932a27500134a463fb7273071 Mon Sep 17 00:00:00 2001 From: Fay Date: Tue, 24 Sep 2019 16:11:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=A4=E6=8D=A2=E4=B8=8B=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/listview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index 30d635018f..e85bfb8858 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -51,9 +51,9 @@ BI.ListView = BI.inherit(BI.Widget, { var width = self.element.width(), height = self.element.height(); if (width !== lastWidth || height !== lastHeight) { - self._calculateBlocksToRender(); lastWidth = width; lastHeight = height; + self._calculateBlocksToRender(); } }); },