From 58b827c1f7252cf98e9d4be51a75fbb8190c3a9d Mon Sep 17 00:00:00 2001 From: chaos0156 <429018715@qq.com> Date: Fri, 12 Aug 2022 17:05:35 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-12408=20chore:=20base=E4=B8=ADeslint?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popup.js | 11 ++++++----- src/base/list/listview.js | 10 +++++----- src/base/list/virtualgrouplist.js | 1 + src/base/list/virtuallist.js | 6 +++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 731510c42..6255975ab 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -380,11 +380,12 @@ BI.PopupView = BI.inherit(BI.Widget, { default: break; } - this.element.removeClass("left") - .removeClass("right") - .removeClass("top") - .removeClass("bottom") - .addClass(direction); + this.element + .removeClass("left") + .removeClass("right") + .removeClass("top") + .removeClass("bottom") + .addClass(direction); this.arrow.element.css(style); this.arrowWrapper.element.css(wrapperStyle); this.placeholder.element.css(placeholderStyle); diff --git a/src/base/list/listview.js b/src/base/list/listview.js index 65f777a99..bca51e3cc 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -21,13 +21,13 @@ BI.ListView = BI.inherit(BI.Widget, { }, init: function () { - var self = this; this.renderedIndex = -1; this.cache = {}; }, render: function () { var self = this, o = this.options; + return { type: "bi.vertical", items: [BI.extend({ @@ -72,10 +72,11 @@ BI.ListView = BI.inherit(BI.Widget, { var index = (this.cache[this.renderedIndex] && (this.cache[this.renderedIndex].index + o.blockSize)) || 0; var cnt = this.renderedIndex + 1; var lastHeight; - var getElementHeight = function () { + function getElementHeight () { return self.container.element.height(); - }; - while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { + } + lastHeight = getElementHeight(); + while ((lastHeight) < minContentHeight && index < o.items.length) { var items = o.items.slice(index, index + o.blockSize); this.container.addItems(items.map(function (item, i) { return o.itemFormatter(item, index + i); @@ -93,7 +94,6 @@ BI.ListView = BI.inherit(BI.Widget, { }, _calculateBlocksToRender: function () { - var o = this.options; this._renderMoreIf(); }, diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index cb8d1b533..2dc5f97a5 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -27,6 +27,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; + return { type: "bi.vertical", items: [{ diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index d5881b30b..7ae32143a 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -20,13 +20,13 @@ BI.VirtualList = BI.inherit(BI.Widget, { }, init: function () { - var self = this; this.renderedIndex = -1; this.cache = {}; }, render: function () { - var self = this, o = this.options; + var self = this; + return { type: "bi.vertical", items: [{ @@ -45,7 +45,7 @@ BI.VirtualList = BI.inherit(BI.Widget, { ref: function () { self.bottomBlank = this; } - }], + }] }; },