@juggle/resize-observer
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -20,6 +20,9 @@ const watchers = []; | ||
events.forEach(name => window.addEventListener(name, dispatch, true)); | ||
if ('MutationObserver' in window) { | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(dispatch).observe(document.body, observerConfig); | ||
} | ||
const createObserver = () => { | ||
if ('MutationObserver' in window) { | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(dispatch).observe(document.body, observerConfig); | ||
} | ||
}; | ||
document.body ? createObserver() : document.addEventListener('DOMContentLoaded', createObserver); | ||
class DOMInteractions { | ||
@@ -26,0 +29,0 @@ static watch(callback) { |
{ | ||
"name": "@juggle/resize-observer", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "ResizeObserver - Based on the official draft specification", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ResizeObserver.js", |
@@ -30,7 +30,11 @@ type StandardCallback = () => any; | ||
// Listen for any other DOM changes which could affect sizes | ||
if ('MutationObserver' in window) { | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(dispatch).observe(document.body, observerConfig); | ||
const createObserver = () => { | ||
if ('MutationObserver' in window) { | ||
const observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; | ||
new MutationObserver(dispatch).observe(document.body, observerConfig); | ||
} | ||
} | ||
document.body ? createObserver() : document.addEventListener('DOMContentLoaded', createObserver); | ||
@@ -37,0 +41,0 @@ class DOMInteractions { |
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
41001
929