added an if statement to catch when we click the last cup to toggle it

This commit is contained in:
lexx54 2020-12-11 10:34:04 -04:00
parent a3282f9023
commit 372af07fd9

View File

@ -10,6 +10,7 @@ smallCups.forEach((cup, idx) => {
})
function highlightCups(idx) {
if (idx===7 && smallCups[idx].classList.contains("full")) idx--;
if(smallCups[idx].classList.contains('full') && !smallCups[idx].nextElementSibling.classList.contains('full')) {
idx--
}