Browse Source

KERNEL-12408 chore: base中eslint修改

es6
chaos0156 2 years ago
parent
commit
58b827c1f7
  1. 3
      src/base/layer/layer.popup.js
  2. 10
      src/base/list/listview.js
  3. 1
      src/base/list/virtualgrouplist.js
  4. 6
      src/base/list/virtuallist.js

3
src/base/layer/layer.popup.js

@ -380,7 +380,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
default: default:
break; break;
} }
this.element.removeClass("left") this.element
.removeClass("left")
.removeClass("right") .removeClass("right")
.removeClass("top") .removeClass("top")
.removeClass("bottom") .removeClass("bottom")

10
src/base/list/listview.js

@ -21,13 +21,13 @@ BI.ListView = BI.inherit(BI.Widget, {
}, },
init: function () { init: function () {
var self = this;
this.renderedIndex = -1; this.renderedIndex = -1;
this.cache = {}; this.cache = {};
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.vertical", type: "bi.vertical",
items: [BI.extend({ 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 index = (this.cache[this.renderedIndex] && (this.cache[this.renderedIndex].index + o.blockSize)) || 0;
var cnt = this.renderedIndex + 1; var cnt = this.renderedIndex + 1;
var lastHeight; var lastHeight;
var getElementHeight = function () { function getElementHeight () {
return self.container.element.height(); 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); var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items.map(function (item, i) { this.container.addItems(items.map(function (item, i) {
return o.itemFormatter(item, index + i); return o.itemFormatter(item, index + i);
@ -93,7 +94,6 @@ BI.ListView = BI.inherit(BI.Widget, {
}, },
_calculateBlocksToRender: function () { _calculateBlocksToRender: function () {
var o = this.options;
this._renderMoreIf(); this._renderMoreIf();
}, },

1
src/base/list/virtualgrouplist.js

@ -27,6 +27,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.vertical", type: "bi.vertical",
items: [{ items: [{

6
src/base/list/virtuallist.js

@ -20,13 +20,13 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}, },
init: function () { init: function () {
var self = this;
this.renderedIndex = -1; this.renderedIndex = -1;
this.cache = {}; this.cache = {};
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this;
return { return {
type: "bi.vertical", type: "bi.vertical",
items: [{ items: [{
@ -45,7 +45,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
ref: function () { ref: function () {
self.bottomBlank = this; self.bottomBlank = this;
} }
}], }]
}; };
}, },

Loading…
Cancel
Save