Browse Source

♻️ Little scripts refactoring

master
Maxim Lebedev 4 months ago
parent
commit
541effccdd
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
  1. 8
      assets/js/cover.js
  2. 4
      assets/js/reel.js

8
assets/js/cover.js

@ -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);
});
}
})();

4
assets/js/reel.js

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

Loading…
Cancel
Save