From ce367678d7fe9e5397ce82726ee9c7ed22a86c11 Mon Sep 17 00:00:00 2001 From: Xamora Date: Fri, 19 Apr 2024 11:23:15 +0200 Subject: [PATCH] better list tournament --- frontend/static/js/api/tournament/Tournament.js | 3 ++- frontend/static/js/views/tournament/TournamentsListView.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/api/tournament/Tournament.js b/frontend/static/js/api/tournament/Tournament.js index 634ee11..c355fc0 100644 --- a/frontend/static/js/api/tournament/Tournament.js +++ b/frontend/static/js/api/tournament/Tournament.js @@ -72,7 +72,8 @@ class Tourmanent extends AExchangeable return; this.connected = false; this._socket.close(); - this.disconnectHandler(event); + if (this.disconnectHandler != null) + this.disconnectHandler(event); } /** diff --git a/frontend/static/js/views/tournament/TournamentsListView.js b/frontend/static/js/views/tournament/TournamentsListView.js index bc6b553..b0a2459 100644 --- a/frontend/static/js/views/tournament/TournamentsListView.js +++ b/frontend/static/js/views/tournament/TournamentsListView.js @@ -1,4 +1,4 @@ -import {client} from "../../index.js"; +import {client, navigateTo} from "../../index.js"; import AbstractAuthenticatedView from "../abstracts/AbstractAuthenticatedView.js"; export default class extends AbstractAuthenticatedView @@ -39,6 +39,11 @@ export default class extends AbstractAuthenticatedView // name let td = document.createElement("td"); td.innerText = tournament.name; + td.onclick = async () => { + await navigateTo(String(tournament.id)); + } + td.style.cursor = "pointer"; + td.style.textDecoration = "underline"; tr.appendChild(td); // state