diff --git a/src/core/wrapper/layout/fill/auto.vtape.js b/src/core/wrapper/layout/fill/auto.vtape.js index 335a95f56..16491ebab 100644 --- a/src/core/wrapper/layout/fill/auto.vtape.js +++ b/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(); },