Skip to content

Commit

Permalink
Merge pull request #96 from fedecarboni7/dev
Browse files Browse the repository at this point in the history
fix deletion logic for created players
  • Loading branch information
fedecarboni7 authored Oct 24, 2024
2 parents 1b8ae66 + b0ad8e7 commit fe88652
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions static/js/script-v1.0.7.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,13 @@ function addPlayer() {
deleteButton.appendChild(trashIcon);

deleteButton.addEventListener("click", function() {
deletePlayer(this);
container.removeChild(playerDiv);
renumerarJugadores();
updateSelectedCount();
updateToggleButtonText();
response = deletePlayer(deleteButton);
if (response) {
container.removeChild(playerDiv);
renumerarJugadores();
updateSelectedCount();
updateToggleButtonText();
}
});
playerHeader.appendChild(deleteButton);

Expand Down Expand Up @@ -500,9 +502,10 @@ function deletePlayer(button) {
container = document.getElementById("players-container");
container.removeChild(button.parentNode.parentNode);
});

updateSelectedCount();
updateSelectedCount();
return true;
}
return false;
}

// Actualizar el texto del botón de seleccionar/deseleccionar según el estado actual de los checkboxes
Expand Down

0 comments on commit fe88652

Please sign in to comment.