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:
+9
-7
@@ -551,17 +551,19 @@
|
|||||||
updateTeamUI();
|
updateTeamUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearTeam() {
|
// Make function global for onclick handler
|
||||||
|
window.clearTeam = function() {
|
||||||
selectedTeam = [];
|
selectedTeam = [];
|
||||||
updateTeamUI();
|
updateTeamUI();
|
||||||
}
|
};
|
||||||
|
|
||||||
function addToTeamFromSuggestion(id) {
|
// Make function global for onclick handler
|
||||||
|
window.addToTeamFromSuggestion = function(id) {
|
||||||
if (!selectedTeam.includes(id) && selectedTeam.length < 4) {
|
if (!selectedTeam.includes(id) && selectedTeam.length < 4) {
|
||||||
selectedTeam.push(id);
|
selectedTeam.push(id);
|
||||||
updateTeamUI();
|
updateTeamUI();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
function updateTeamUI() {
|
function updateTeamUI() {
|
||||||
// Update operator selection
|
// Update operator selection
|
||||||
@@ -658,8 +660,8 @@
|
|||||||
// Initialize
|
// Initialize
|
||||||
initOperatorSelect();
|
initOperatorSelect();
|
||||||
|
|
||||||
// Builds Modal Functions
|
// Builds Modal Functions - global for onclick
|
||||||
function showTeamBuilds() {
|
window.showTeamBuilds = function() {
|
||||||
if (selectedTeam.length === 0) {
|
if (selectedTeam.length === 0) {
|
||||||
alert('Please select at least one operator first!');
|
alert('Please select at least one operator first!');
|
||||||
return;
|
return;
|
||||||
@@ -722,7 +724,7 @@
|
|||||||
document.body.style.overflow = 'hidden';
|
document.body.style.overflow = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeBuildsModal() {
|
window.closeBuildsModal = function() {
|
||||||
const modal = document.getElementById('buildsModal');
|
const modal = document.getElementById('buildsModal');
|
||||||
modal.classList.remove('active');
|
modal.classList.remove('active');
|
||||||
document.body.style.overflow = '';
|
document.body.style.overflow = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user