fix: reverts 12533f3b376328a8437109977910c8f2041572e5
fixes: #371 and #396
This commit is contained in:
parent
7b5af70d80
commit
92c31af629
@ -115,16 +115,17 @@ export default class BaseChart {
|
||||
|
||||
// Bind window events
|
||||
this.boundDrawFn = () => this.draw(true);
|
||||
if (ResizeObserver) {
|
||||
this.resizeObserver = new ResizeObserver(this.boundDrawFn);
|
||||
this.resizeObserver.observe(this.parent);
|
||||
}
|
||||
// Look into improving responsiveness
|
||||
//if (ResizeObserver) {
|
||||
// this.resizeObserver = new ResizeObserver(this.boundDrawFn);
|
||||
// this.resizeObserver.observe(this.parent);
|
||||
//}
|
||||
window.addEventListener("resize", this.boundDrawFn);
|
||||
window.addEventListener("orientationchange", this.boundDrawFn);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if (this.resizeObserver) this.resizeObserver.disconnect();
|
||||
//if (this.resizeObserver) this.resizeObserver.disconnect();
|
||||
window.removeEventListener("resize", this.boundDrawFn);
|
||||
window.removeEventListener("orientationchange", this.boundDrawFn);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user