25 September 2017
https://debs-obrien.github.io/restaurant-reviews-OpenClassRooms-project-7

/*-----------------------------------------------------------------------------------
Builds the small info Window
-------------------------------------------------------------------------------------*/
function buildIWContentSmall(place) {
document.getElementById('iw-icon-small').innerHTML = '<img class="photo" ' + 'src="' + createPhoto(place) + '"/>';
document.getElementById('iw-url-small').innerHTML = '<b>' + place.name + '</b>';
if (place.rating) {
let ratingHtml = '';
for (let i = 0; i < 5; i++) {
if (place.rating < (i + 0.5)) {
ratingHtml += '✩';
} else {
ratingHtml += '✭';
}
document.getElementById('iw-rating-small').style.display = '';
document.getElementById('iw-rating-small').innerHTML = ratingHtml;
}
} else {
document.getElementById('iw-rating-small').style.display = 'none';
}
}
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.