Browse Source

feature: 增加IE9支持的vertical_fill动态布局

es6
guy 3 years ago
parent
commit
68584c07a1
  1. 9
      src/core/wrapper/layout/fill/auto.vtape.js

9
src/core/wrapper/layout/fill/auto.vtape.js

@ -94,6 +94,10 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, {
},
mounted: function () {
if (window.ResizeObserver) {
this.resizeObserver = new window.ResizeObserver(this._handleResize.bind(this));
this.resizeObserver.observe(this.element[0]);
}
if (window.MutationObserver) {
this.mutationObserver = new window.MutationObserver(this._handleResize.bind(this));
this.mutationObserver.observe(this.element[0], {
@ -105,6 +109,11 @@ BI.AutoVerticalTapeLayout = BI.inherit(BI.Layout, {
this._handleResize();
},
destroyed: function () {
this.resizeObserver && this.resizeObserver.unobserve(this.element[0]);
this.mutationObserver && this.mutationObserver.disconnect();
},
resize: function () {
this.layout.resize();
},

Loading…
Cancel
Save