dropdowns refactor
This commit is contained in:
parent
4b3c76d1a7
commit
9f4d56b627
@ -7,7 +7,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
//const familyGrid = document.getElementById("familyGrid")
|
//const familyGrid = document.getElementById("familyGrid")
|
||||||
|
|
||||||
// Initialize dropdowns
|
// Initialize dropdowns
|
||||||
updateMonstersDropdown();
|
updateMonstersDropdownByFamily();
|
||||||
// Initialize Family Grid();
|
// Initialize Family Grid();
|
||||||
// populateFamilyGrid();
|
// populateFamilyGrid();
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
|
|
||||||
// Listeners for Dropdown Changes
|
// Listeners for Dropdown Changes
|
||||||
familyDropdown.addEventListener("change", function () {
|
familyDropdown.addEventListener("change", function () {
|
||||||
updateMonstersDropdown();
|
updateMonstersDropdownByFamily();
|
||||||
});
|
});
|
||||||
|
|
||||||
monsterDropdown.addEventListener("change", function () {
|
monsterDropdown.addEventListener("change", function () {
|
||||||
@ -35,7 +35,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
|
|
||||||
// Listener for a click on a breeding parent
|
// Listener for a click on a breeding parent
|
||||||
//parent.addEventListener("click", function() {
|
//parent.addEventListener("click", function() {
|
||||||
// updateMonstersDropdown();
|
// updateMonstersDropdownBySelected();
|
||||||
// updateIFrames();
|
// updateIFrames();
|
||||||
//});
|
//});
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function updateMonstersDropdown() {
|
function updateMonstersDropdownByFamily() {
|
||||||
const selectedFamily = familyDropdown.value;
|
const selectedFamily = familyDropdown.value;
|
||||||
|
|
||||||
// Fetch monsters data from the server based on the selected family
|
// Fetch monsters data from the server based on the selected family
|
9
static/js/updateMonstersDropdownBySelected.js
Normal file
9
static/js/updateMonstersDropdownBySelected.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//function updateMonstersDropdownBySelected() {
|
||||||
|
// const selectedMonster = parent.value;
|
||||||
|
//
|
||||||
|
// // Fetch monsters data from the server based on the selected monster
|
||||||
|
// fetch(`/monster/${selectedMonster}`)
|
||||||
|
// .then(response => response.json())
|
||||||
|
// .then(data => populateDropdown(monsterDropdown, data))
|
||||||
|
// .catch(error => console.error("Error fetching monsters:", error));
|
||||||
|
//}
|
Loading…
Reference in New Issue
Block a user