Fix: Make onclick handlers work by using window.*

- addToTeamFromSuggestion - now global, clicking suggestions works
- clearTeam - now global
- showTeamBuilds - now global
- closeBuildsModal - now global

Inline onclick handlers need global scope functions
This commit is contained in:
itsaygea
2026-01-24 09:04:37 -07:00
parent 393cddc903
commit 03b88dbddc
+9 -7
View File
@@ -551,17 +551,19 @@
updateTeamUI();
}
function clearTeam() {
// Make function global for onclick handler
window.clearTeam = function() {
selectedTeam = [];
updateTeamUI();
}
};
function addToTeamFromSuggestion(id) {
// Make function global for onclick handler
window.addToTeamFromSuggestion = function(id) {
if (!selectedTeam.includes(id) && selectedTeam.length < 4) {
selectedTeam.push(id);
updateTeamUI();
}
}
};
function updateTeamUI() {
// Update operator selection
@@ -658,8 +660,8 @@
// Initialize
initOperatorSelect();
// Builds Modal Functions
function showTeamBuilds() {
// Builds Modal Functions - global for onclick
window.showTeamBuilds = function() {
if (selectedTeam.length === 0) {
alert('Please select at least one operator first!');
return;
@@ -722,7 +724,7 @@
document.body.style.overflow = 'hidden';
}
function closeBuildsModal() {
window.closeBuildsModal = function() {
const modal = document.getElementById('buildsModal');
modal.classList.remove('active');
document.body.style.overflow = '';