Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Donot committed May 24, 2024
1 parent b6795c8 commit fec1912
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions script/leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ document.addEventListener('DOMContentLoaded', async function() {
mapLeaderboardElement.appendChild(userDiv);
});
}
document.getElementById('mapSelect').addEventListener('change', async (event) => {
const mapId = event.target.value;
if (mapId) {
await createMapLeaderboard(mapId);
} else {
// Clear map leaderboard if no map selected
const mapLeaderboardElement = document.getElementById('mapLeaderboard');
mapLeaderboardElement.innerHTML = '';
}
});

document.getElementById('navButton1').addEventListener('click', () => {
document.querySelector('.leaderboard-container').style.display = 'block';
Expand Down Expand Up @@ -140,16 +150,7 @@ function fillMapLeaderboardSelectBox(){
}
}

document.getElementById('mapSelect').addEventListener('change', async (event) => {
const mapId = event.target.value;
if (mapId) {
await createMapLeaderboard(mapId);
} else {
// Clear map leaderboard if no map selected
const mapLeaderboardElement = document.getElementById('mapLeaderboard');
mapLeaderboardElement.innerHTML = '';
}
});


function getMapByName(name) {
for (let map_id in maps) {
Expand Down

0 comments on commit fec1912

Please sign in to comment.