dwm-app/static/js/updateIFrames.js

20 lines
642 B
JavaScript
Raw Normal View History

2024-02-02 02:52:59 +00:00
function updateIframes() {
const selectedFamily = familyDropdown.value;
const selectedMonster = monsterDropdown.value;
2024-02-02 02:52:59 +00:00
// Update monsterIframe src based on selected family and monster
const monsterIframeSrc = selectedMonster
? `/monster/${selectedMonster}`
: selectedFamily
2024-02-02 02:52:59 +00:00
? `/monster/${selectedFamily}`
: "about:blank";
monsterIframe.src = monsterIframeSrc;
2024-02-02 02:52:59 +00:00
// Update breedingIframe src based on the selected monster
const breedingIframeSrc = selectedMonster
? `/breeds?monster=${selectedMonster}`
: "about:blank";
2024-02-02 02:52:59 +00:00
breedingIframe.src = breedingIframeSrc;
}