Olá segue a lista de exercicios.
li.onclick = () => {
document.querySelectorAll('.app__section-task-list-item-active')
.forEach(elemento =>{
elemento.classList.remove('app__section-task-list-item-active')
})
if (tarefaSelecionada == tarefa) {
paragrafoDescricaoTarefa.textContent = ''
tarefaSelecionada = null
litarefaSelecionada = null
return
}
tarefaSelecionada = tarefa
litarefaSelecionada = li
paragrafoDescricaoTarefa.textContent = tarefa.descricao
li.classList.add('app__section-task-list-item-active')
}
return li
}
document.addEventListener('FocoFinalizado', ()=>{
console.log('Tarefa de foco finalizada!');
if (tarefaSelecionada && litarefaSelecionada) {
litarefaSelecionada.classList.remove('app__section-task-list-item-active')
litarefaSelecionada.classList.add('app__section-task-list-item-complete')
litarefaSelecionada.querySelector('button').setAttribute('disabled','disabled')
}
})