mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 15:22:35 -05:00
Tournaments: support showing users who have joined
During signups in elimination tournaments, show the number of users who have joined in place of the empty bracket
This commit is contained in:
@@ -551,8 +551,14 @@
|
||||
|
||||
TournamentBox.prototype.generateBracket = function (data) {
|
||||
if (data.type === 'tree') {
|
||||
if (!data.rootNode)
|
||||
return;
|
||||
var $div = $('<div class="tournament-bracket-tree"></div>');
|
||||
|
||||
if (!data.rootNode) {
|
||||
if (!('users' in data)) return;
|
||||
var users = data.users.length;
|
||||
if (users) $div.html('<b>' + users + '</b> user' + (users !== 1 ? 's' : '') + ':<br />' + data.users.join(", "));
|
||||
return $div;
|
||||
}
|
||||
|
||||
var name = app.user.get('name');
|
||||
var nodeSize = {
|
||||
@@ -561,8 +567,6 @@
|
||||
separationX: 30, separationY: 15
|
||||
};
|
||||
|
||||
var $div = $('<div class="tournament-bracket-tree"></div>');
|
||||
|
||||
var nodesByDepth = [];
|
||||
var stack = [{node: data.rootNode, depth: 0}];
|
||||
while (stack.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user