Browse Source

无JRIA fix: destoryed前释放ResizeDetector

es6
zsmj 2 years ago
parent
commit
f8eb30a4c9
  1. 3
      src/base/list/listview.js
  2. 5
      src/base/list/virtualgrouplist.js
  3. 8
      src/base/list/virtuallist.js

3
src/base/list/listview.js

@ -128,7 +128,8 @@ BI.ListView = BI.inherit(BI.Widget, {
this._populate(items); this._populate(items);
}, },
destroyed: function () { beforeDestroy: function () {
BI.ResizeDetector.removeResizeListener(this);
this.restore(); this.restore();
}, },
}); });

5
src/base/list/virtualgrouplist.js

@ -181,6 +181,11 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
populate: function (items) { populate: function (items) {
this._populate(items); this._populate(items);
}, },
beforeDestroy: function () {
BI.ResizeDetector.removeResizeListener(this);
this.restore();
}
}); });
BI.shortcut("bi.virtual_group_list", BI.VirtualGroupList); BI.shortcut("bi.virtual_group_list", BI.VirtualGroupList);

8
src/base/list/virtuallist.js

@ -201,10 +201,10 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this._populate(items); this._populate(items);
}, },
destroyed: function () { beforeDestroy: function () {
this.cache = {}; BI.ResizeDetector.removeResizeListener(this);
this.renderedIndex = -1; this.restore();
}, }
}); });
BI.shortcut("bi.virtual_list", BI.VirtualList); BI.shortcut("bi.virtual_list", BI.VirtualList);

Loading…
Cancel
Save