* Complete add-player modal
* New player listing * New player action layout
This commit is contained in:
@@ -9,21 +9,19 @@ function setupClanButtons(dropdownId, delBtnId, editBtnId) {
|
||||
});
|
||||
}
|
||||
|
||||
function setupPlayerButtons(dropdownId, listId, delBtnId, editBtnId, addBtnId) {
|
||||
function getSelectedClanId(dropdownId) {
|
||||
const dropdown = document.getElementById(dropdownId);
|
||||
const selectedClanId = dropdown.options[dropdown.selectedIndex].value;
|
||||
return parseInt(selectedClanId);
|
||||
}
|
||||
|
||||
function setupPlayerButtons(dropdownId, listId, addBtnId) {
|
||||
const dropdown = document.getElementById(dropdownId);
|
||||
const deleteButton = document.getElementById(delBtnId);
|
||||
const editButton = document.getElementById(editBtnId);
|
||||
const addButton = document.getElementById(addBtnId);
|
||||
|
||||
dropdown.addEventListener('change', function () {
|
||||
deleteButton.disabled = !this.value;
|
||||
editButton.disabled = !this.value && (dropdown.selectedIndex !== -1);
|
||||
addButton.disabled = !this.value && (dropdown.selectedIndex !== -1);
|
||||
});
|
||||
|
||||
dropdown.addEventListener('change', function () {
|
||||
deleteButton.disabled = (this.selectedIndex !== -1);
|
||||
editButton.disabled = (this.selectedIndex !== -1);
|
||||
addButton.classList.toggle("bg-secondary-subtle");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user