Skip to content

Commit

Permalink
Moving optionSelected function into isActive if logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tramirez30 committed Dec 18, 2024
1 parent 3e73d61 commit d76e40b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,15 @@ let isActive = (e) => {
dropDown.classList.toggle("is-active");
icon.classList = "fas fa-angle-up";
} else {
optionSelected();
closeDropdown();
}
optionSelected();
};

// Option function selected

let optionSelected = (e) => {
if (option.contains(e.target)) {
dropDown.classList.remove("is-active");
icon.classList = "fas fa-angle-down";
}
};
Expand Down

0 comments on commit d76e40b

Please sign in to comment.