refactoring and renaming intersection observer for chapters
This commit is contained in:
parent
7b8f5b8751
commit
aebf62a903
|
|
@ -30,8 +30,8 @@ export default function singleConseil() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register IntersectionObserver
|
// CHAPTER IntersectionObserver
|
||||||
const io = new IntersectionObserver(
|
const chapterProgressionObserver = new IntersectionObserver(
|
||||||
(entries) => {
|
(entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
|
|
@ -66,8 +66,7 @@ export default function singleConseil() {
|
||||||
|
|
||||||
allBlocks = buildAllBlocksToObserve();
|
allBlocks = buildAllBlocksToObserve();
|
||||||
|
|
||||||
allBlocks.forEach((el) => {
|
allBlocks.forEach((block) => {
|
||||||
console.log(el);
|
chapterProgressionObserver.observe(block);
|
||||||
io.observe(el);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user