2024-02-02 02:52:59 +00:00
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
const familyDropdown = document.getElementById("familyDropdown");
|
|
|
|
const monsterDropdown = document.getElementById("monsterDropdown");
|
2024-02-02 15:03:55 +00:00
|
|
|
// Implementing Family Icon Grid in place of family dropdown
|
|
|
|
//const familyGrid = document.getElementById("familyGrid")
|
2024-02-02 02:52:59 +00:00
|
|
|
|
2024-02-02 15:03:55 +00:00
|
|
|
// Initialize dropdowns
|
2024-02-02 02:52:59 +00:00
|
|
|
updateMonstersDropdown();
|
2024-02-02 15:03:55 +00:00
|
|
|
// Initialize Family Grid();
|
|
|
|
// populateFamilyGrid();
|
2024-02-02 02:52:59 +00:00
|
|
|
|
2024-02-02 15:03:55 +00:00
|
|
|
// Fetch families data from the server and populate families dropdown
|
2024-02-02 02:52:59 +00:00
|
|
|
fetch("/get_families")
|
|
|
|
.then(response => response.json())
|
|
|
|
.then(data => {
|
|
|
|
populateDropdown(familyDropdown, data);
|
|
|
|
})
|
|
|
|
.catch(error => console.error("Error fetching families:", error));
|
|
|
|
|
2024-02-02 15:03:55 +00:00
|
|
|
// Listeners for Dropdown Changes
|
2024-02-02 02:52:59 +00:00
|
|
|
familyDropdown.addEventListener("change", function () {
|
|
|
|
updateMonstersDropdown();
|
|
|
|
});
|
|
|
|
|
|
|
|
monsterDropdown.addEventListener("change", function () {
|
|
|
|
updateIframes();
|
|
|
|
});
|
|
|
|
|
2024-02-02 15:03:55 +00:00
|
|
|
// Listener for a click on the one of the family icons
|
|
|
|
//familyGrid.addEventListener("on click", function() {
|
|
|
|
// updateMonsterGrid(); // Need a function for this too...
|
|
|
|
//});
|
2024-02-02 02:52:59 +00:00
|
|
|
|
|
|
|
});
|