1
0
Fork 0

♻️ Little scripts refactoring

This commit is contained in:
Maxim Lebedev 2022-02-25 02:31:58 +05:00
parent 6098259eb7
commit 541effccdd
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
2 changed files with 6 additions and 6 deletions

View File

@ -8,9 +8,11 @@
};
if ('IntersectionObserver' in window) {
covers.forEach(t => t.setAttribute('data-observe', ''));
const observer = new IntersectionObserver(toggleVisibleData);
covers.forEach(t => observer.observe(t));
covers.forEach(t => {
t.setAttribute('data-observe', '');
observer.observe(t);
});
}
})();

View File

@ -15,9 +15,7 @@
if ('MutationObserver' in window) {
new MutationObserver(entries => {
toggleOverflowClass(entries[0].target);
}).observe(reel, {
childList: true
});
}).observe(reel, { childList: true });
}
}
})();