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
|
||||
const io = new IntersectionObserver(
|
||||
// CHAPTER IntersectionObserver
|
||||
const chapterProgressionObserver = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
|
|
@ -66,8 +66,7 @@ export default function singleConseil() {
|
|||
|
||||
allBlocks = buildAllBlocksToObserve();
|
||||
|
||||
allBlocks.forEach((el) => {
|
||||
console.log(el);
|
||||
io.observe(el);
|
||||
allBlocks.forEach((block) => {
|
||||
chapterProgressionObserver.observe(block);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user