From 94d6af623aed66a1ba603023bf5484c0ecb8b3ab Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 10 Jan 2022 23:50:38 +0700 Subject: [PATCH] Fix undefined bug in ranking --- templates/contest/ranking.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/contest/ranking.html b/templates/contest/ranking.html index b856755..c0d4e04 100644 --- a/templates/contest/ranking.html +++ b/templates/contest/ranking.html @@ -321,7 +321,7 @@ function get_initial_rank() { var ranks = $('.rank-td').map(function() {return this.innerHTML}).get(); - var usernames = $('.user-name .user a').map(function() {return this.text}).get(); + var usernames = $('.user-name .rating a').map(function() {return this.text}).get(); window.user_rank = new Map(); for (var i = 0; i < ranks.length; i++) { window.user_rank[usernames[i]] = ranks[i]; @@ -329,7 +329,7 @@ } function add_initial_friend_rank() { - var usernames = $('.user-name .user a').map(function() {return this.text}).get(); + var usernames = $('.user-name .rating a').map(function() {return this.text}).get(); var is_virtual = []; $('.user-name').each(function() { @@ -338,7 +338,6 @@ } else is_virtual.push(0); }); - console.log(is_virtual); $('.rank-td').each(function(i) { if (!is_virtual[i]) this.innerHTML += ' (' + window.user_rank[usernames[i]] + ')';