added an if statement to catch when we click the last cup to toggle it
This commit is contained in:
parent
a3282f9023
commit
372af07fd9
@ -10,6 +10,7 @@ smallCups.forEach((cup, idx) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function highlightCups(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')) {
|
if(smallCups[idx].classList.contains('full') && !smallCups[idx].nextElementSibling.classList.contains('full')) {
|
||||||
idx--
|
idx--
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user