Merge pull request #25 from lexx54/water_toggle
added an if statement to catch when we click the last cup to toggle it
This commit is contained in:
commit
f2462bb1e1
@ -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