Skip to content

Commit

Permalink
added deactivation of changeButton at Start, and added activation of …
Browse files Browse the repository at this point in the history
…changeButton after Change of Radio-Buttons in tree-property-section
  • Loading branch information
mafo3186 committed Nov 12, 2023
1 parent fd8b4a2 commit 37537ed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ animationSpeedSlider.value = 7;
let speed = 7;
let pause = false;
deactivateButton(animationPauseButton);
deactivateButton(changeTypeButton);
let animationId = null;
let oldTree = [];
let tempTree = [];
Expand Down Expand Up @@ -209,6 +210,18 @@ resetButton.addEventListener('click', function(){
}
});

radiosTreeType.forEach(radioButton => {
radioButton.addEventListener('change', function() {
activateButton(changeTypeButton);
});
});

radiosInputType.forEach(radioButton => {
radioButton.addEventListener('change', function() {
activateButton(changeTypeButton);
});
});

changeTypeButton.addEventListener('click', function(){
if (confirm("Um den Typ zu ändern, wird der aktuelle Baum gelöscht.")){
for (const radioButton of radiosTreeType) {
Expand All @@ -225,6 +238,7 @@ changeTypeButton.addEventListener('click', function(){
break;
}
}
deactivateButton(changeTypeButton);
}
});

Expand Down

0 comments on commit 37537ed

Please sign in to comment.