From 03b88dbddc631f7def14bb47fc0c583e3b9b3946 Mon Sep 17 00:00:00 2001 From: itsaygea Date: Sat, 24 Jan 2026 09:04:37 -0700 Subject: [PATCH] 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 --- js/main.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/main.js b/js/main.js index 777a909..3f1e3db 100644 --- a/js/main.js +++ b/js/main.js @@ -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 = '';