resize-observer-lite
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -24,10 +24,12 @@ "use strict"; | ||
} | ||
if (this.hasResizeObserver) { | ||
this.rz.observe(element); | ||
if (element) { | ||
if (this.hasResizeObserver) { | ||
this.rz.observe(element); | ||
} | ||
else { | ||
this.erd.listenTo(element, function (element) { | ||
_this.handler(getSize(element)); | ||
}); | ||
} | ||
} | ||
else { | ||
this.erd.listenTo(element, function (element) { | ||
_this.handler(getSize(element)); | ||
}); | ||
} | ||
this.listenedElement = element; | ||
@@ -37,9 +39,11 @@ } | ||
ResizeObserverLite.prototype.disconnect = function () { | ||
if (this.hasResizeObserver) { | ||
this.rz.disconnect(); | ||
if (this.listenedElement) { | ||
if (this.hasResizeObserver) { | ||
this.rz.disconnect(); | ||
} | ||
else { | ||
this.erd.uninstall(this.listenedElement); | ||
} | ||
this.listenedElement = null; | ||
} | ||
else { | ||
this.erd.uninstall(this.listenedElement); | ||
} | ||
this.listenedElement = null; | ||
}; | ||
@@ -46,0 +50,0 @@ return ResizeObserverLite; |
{ | ||
"name": "resize-observer-lite", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A ResizeObserver polyfill that has limited functionality of ResizeObserver.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
6575
78