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

pull/25/head
lexx54 4 years ago
parent a3282f9023
commit 372af07fd9

@ -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--
}

Loading…
Cancel
Save