forked from udacity/mws-restaurant-stage-3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fav icon func fix, sw fix for problematic cache, add review font…
…-size adjustment
- Loading branch information
Showing
20 changed files
with
296 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
|
||
console.log('intersection.js'); | ||
let idIntersectingElement; | ||
var io = new IntersectionObserver(entries => { | ||
console.log('iointersect'); | ||
let idIntersectingElement; | ||
var io = new IntersectionObserver(entries => { | ||
console.log('iointersect'); | ||
|
||
entries.forEach(entry => { | ||
entries.forEach(entry => { | ||
if(entry.isIntersecting) { | ||
//console.log('intersecting',entry.target.id,entry); | ||
let idStr = entry.target.childNodes[0].id; | ||
let idNumber = idStr.replace( /^\D+/g, ''); | ||
idNumber = Number(idNumber); | ||
idIntersectingElement = idNumber; | ||
console.log('load image from intersect:',res.restaurants[idNumber-1]) | ||
loadImage(res.restaurants[idNumber-1],idStr); | ||
io.unobserve(entry.target); | ||
} | ||
}); | ||
}); | ||
}); | ||
|
||
|
||
addIntersection = () => { | ||
//console.log('addIntersection'); | ||
let el2 = document.querySelectorAll('#restaurants-list li'); | ||
//console.log('el2:',el2); | ||
el2.forEach(e => { | ||
io.observe(e); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.