mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-12-26 17:09:09 +00:00
Select default_plate image when no food image uploaded
This commit is contained in:
parent
e6ac5ea33d
commit
0b7e101bb2
@ -157,7 +157,7 @@ class ReviewCard extends HTMLElement {
|
|||||||
mealImg.setAttribute("alt","Meal Photo Corrupted");
|
mealImg.setAttribute("alt","Meal Photo Corrupted");
|
||||||
mealImg.setAttribute("src",data["mealImg"]);
|
mealImg.setAttribute("src",data["mealImg"]);
|
||||||
mealImg.addEventListener("error", function(e) {
|
mealImg.addEventListener("error", function(e) {
|
||||||
mealImg.setAttribute("src", "./assets/images/plate_with_cutlery.png");
|
mealImg.setAttribute("src", "./assets/images/default_plate.png");
|
||||||
e.onerror = null;
|
e.onerror = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ function setupInfo(){
|
|||||||
let mealImg = document.getElementById("d-mealImg");
|
let mealImg = document.getElementById("d-mealImg");
|
||||||
mealImg.setAttribute("src",currReview["mealImg"]);
|
mealImg.setAttribute("src",currReview["mealImg"]);
|
||||||
mealImg.addEventListener("error", function(e) {
|
mealImg.addEventListener("error", function(e) {
|
||||||
mealImg.setAttribute("src", "./assets/images/plate_with_cutlery.png");
|
mealImg.setAttribute("src", "./assets/images/default_plate.png");
|
||||||
e.onerror = null;
|
e.onerror = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user