From 7338d347655fa9497b312afb4e79f5bb407248fa Mon Sep 17 00:00:00 2001 From: MaxJa4 <74194322+MaxJa4@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:36:19 +0100 Subject: [PATCH] Bugfixes and tooltips for full-calc ui. --- controllers/tracker_controller.go | 6 +++--- templates/modals/full_calc.html | 24 +++++++++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/controllers/tracker_controller.go b/controllers/tracker_controller.go index 630e8ed..acbb16f 100644 --- a/controllers/tracker_controller.go +++ b/controllers/tracker_controller.go @@ -38,11 +38,11 @@ func GetScoreByPlayerID(c *gin.Context) { case 200: c.String(200, fmt.Sprintf("%.2f", score)) case 404: - c.String(200, "") + c.String(200, "") case 503, 504: - c.String(statusCode, "") + c.String(statusCode, "") default: - c.String(statusCode, "") + c.String(statusCode, "") utils.Logger.Warnf("[SCORE] Invalid request! Player: %s, Score: %f", player.Name, score) } } diff --git a/templates/modals/full_calc.html b/templates/modals/full_calc.html index 186a42d..fd1820f 100644 --- a/templates/modals/full_calc.html +++ b/templates/modals/full_calc.html @@ -23,19 +23,19 @@
- Avg + Avg
- +
- Avg + Avg @@ -47,7 +47,7 @@
Lade...
-
@@ -85,6 +85,8 @@ score.innerHTML = text; if (!isNaN(parseFloat(text))) score.previousElementSibling.hidden = false; + else + initTooltips(score); return text; }); } @@ -239,7 +241,7 @@ } function cleanupStatistic(statisticField) { - if (statisticField.innerHTML === spinnerGrow) + if (statisticField.innerHTML.trim() === spinnerGrow) statisticField.innerHTML = dash; } @@ -299,11 +301,15 @@ Promise.all(promises).then(_ => { let liItems = homeClanResults.querySelectorAll('li'); - liItems[liItems.length - 1].classList.remove('border-bottom'); - liItems[liItems.length - 2].classList.remove('border-bottom'); + if (liItems.length > 1) { + liItems[liItems.length - 1].classList.remove('border-bottom'); + liItems[liItems.length - 2].classList.remove('border-bottom'); + } liItems = oppClanResults.querySelectorAll('li'); - liItems[liItems.length - 1].classList.remove('border-bottom'); - liItems[liItems.length - 2].classList.remove('border-bottom'); + if (liItems.length > 1) { + liItems[liItems.length - 1].classList.remove('border-bottom'); + liItems[liItems.length - 2].classList.remove('border-bottom'); + } setSquadNumbers();