liquid-tank
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -23,4 +23,10 @@ (function() { | ||
this.render(); | ||
this.onResize = _debounce(this.onResize.bind(this), 66); | ||
window.addEventListener("resize", this.onResize); | ||
if (window.hasOwnProperty("ResizeObserver")) { | ||
this.onResize = this.onResize.bind(this); | ||
this._resizeObserver = new ResizeObserver(this.onResize); | ||
this._resizeObserver.observe(this.element); | ||
} else { | ||
this.onResize = _debounce(this.onResize.bind(this), 66); | ||
window.addEventListener("resize", this.onResize); | ||
} | ||
return this; | ||
@@ -34,3 +40,11 @@ } | ||
this.element.removeChild(this.canvas); | ||
window.removeEventListener("resize", this.onResize); | ||
if (window.hasOwnProperty("ResizeObserver")) { | ||
if (this._resizeObserver) { | ||
this._resizeObserver.unobserve(this.element); | ||
this._resizeObserver.disconnect(); | ||
this._resizeObserver; | ||
} | ||
} else { | ||
window.removeEventListener("resize", this.onResize); | ||
} | ||
}; | ||
@@ -37,0 +51,0 @@ |
{ | ||
"name": "liquid-tank", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "liquid-tank.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16666
339