summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lambda-calcul/haskell/public/leaderboard.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lambda-calcul/haskell/public/leaderboard.js b/lambda-calcul/haskell/public/leaderboard.js
index 15b5b42..7541701 100644
--- a/lambda-calcul/haskell/public/leaderboard.js
+++ b/lambda-calcul/haskell/public/leaderboard.js
@@ -14,12 +14,6 @@ const updateLeaderboard = () => {
data.forEach((entry, index) => {
const row = document.createElement('tr');
- if(entry.lastResult) {
- row.classList.add('success');
- } else if (!entry.lastResult && entry.lastTest){
- row.classList.add('fail');
- }
-
const nameCell = document.createElement('td');
nameCell.textContent = entry.user;
row.appendChild(nameCell);
@@ -32,6 +26,12 @@ const updateLeaderboard = () => {
timeCell.textContent = entry.lastTest;
row.appendChild(timeCell);
+ if(entry.lastResult) {
+ timeCell.classList.add('success');
+ } else if (!entry.lastResult && entry.lastTest){
+ timeCell.classList.add('fail');
+ }
+
tbody.appendChild(row);
});
})