Refactor toggleSnowstorm function: streamline observer setup by removing unnecessary comments
This commit is contained in:
@@ -49,12 +49,10 @@ function toggleSnowstorm() {
|
|||||||
|
|
||||||
// observe changes in the DOM
|
// observe changes in the DOM
|
||||||
const observer = new MutationObserver(toggleSnowstorm);
|
const observer = new MutationObserver(toggleSnowstorm);
|
||||||
|
|
||||||
// start observation
|
|
||||||
observer.observe(document.body, {
|
observer.observe(document.body, {
|
||||||
childList: true, // observe adding/removing of child elements
|
childList: true,
|
||||||
subtree: true, // observe all levels of the DOM tree
|
subtree: true,
|
||||||
attributes: true // observe changes to attributes (e.g. class changes)
|
attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
let resizeObserver; // Observer for resize events
|
let resizeObserver; // Observer for resize events
|
||||||
|
|||||||
Reference in New Issue
Block a user