♻️ Little scripts refactoring
This commit is contained in:
parent
6098259eb7
commit
541effccdd
|
@ -8,9 +8,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
if ('IntersectionObserver' in window) {
|
if ('IntersectionObserver' in window) {
|
||||||
covers.forEach(t => t.setAttribute('data-observe', ''));
|
|
||||||
|
|
||||||
const observer = new IntersectionObserver(toggleVisibleData);
|
const observer = new IntersectionObserver(toggleVisibleData);
|
||||||
covers.forEach(t => observer.observe(t));
|
|
||||||
|
covers.forEach(t => {
|
||||||
|
t.setAttribute('data-observe', '');
|
||||||
|
observer.observe(t);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -15,9 +15,7 @@
|
||||||
if ('MutationObserver' in window) {
|
if ('MutationObserver' in window) {
|
||||||
new MutationObserver(entries => {
|
new MutationObserver(entries => {
|
||||||
toggleOverflowClass(entries[0].target);
|
toggleOverflowClass(entries[0].target);
|
||||||
}).observe(reel, {
|
}).observe(reel, { childList: true });
|
||||||
childList: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue