Browse Source

BI-101931 virtualgrouplist稍快滚动大量空白

es6
windy 3 years ago
parent
commit
c5a521a0b4
  1. 13
      src/base/list/virtualgrouplist.js

13
src/base/list/virtualgrouplist.js

@ -61,10 +61,17 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
this._populate(); this._populate();
this.element.scroll(BI.debounce(function (e) { this.ticking = false;
this.element.scroll(function() {
o.scrollTop = self.element.scrollTop(); o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender(); if (!self.ticking) {
}, 30)); requestAnimationFrame(function () {
self._calculateBlocksToRender();
self.ticking = false;
});
self.ticking = true;
}
});
BI.ResizeDetector.addResizeListener(this, function () { BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender(); self._calculateBlocksToRender();
}); });

Loading…
Cancel
Save