From ac0415faddacd9ccf95c32de929d464dc6e814b6 Mon Sep 17 00:00:00 2001 From: Xevion Date: Fri, 26 Jun 2020 09:35:40 -0500 Subject: [PATCH] fixed scrolling and table column padding/spacing --- trivia/static/script.js | 8 ++++++-- trivia/static/style.css | 1 + trivia/templates/index.html | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/trivia/static/script.js b/trivia/static/script.js index fed5c87..26c5b41 100644 --- a/trivia/static/script.js +++ b/trivia/static/script.js @@ -14,11 +14,11 @@ let REFRESH_TIMEOUT; function ScrollOnce(autoscroll) { // If autoscroll has been disabled in between timer, this if statement will prevent it from executing. if (AUTOSCROLL) - $(".team-row:first").appendTo("tbody") + $(".ui-row:first").appendTo("tbody") // Restart autoscroll as needed. if (autoscroll && AUTOSCROLL) { - setTimeout(function () { + SCROLL_TIMEOUT = setTimeout(function () { ScrollOnce(true) }, SCROLL_INTERVAL) } @@ -30,9 +30,13 @@ function ToggleAutoscroll() { if (AUTOSCROLL) { $(".js-scroll-row-start").hide(); $(".js-scroll-row-stop").show(); + + ScrollOnce(true); } else { $(".js-scroll-row-start").show(); $(".js-scroll-row-stop").hide(); + + clearTimeout(SCROLL_TIMEOUT); } } diff --git a/trivia/static/style.css b/trivia/static/style.css index 71dc63a..605fca4 100644 --- a/trivia/static/style.css +++ b/trivia/static/style.css @@ -19,6 +19,7 @@ tr[data-row-index="0"] td { border-top: 0.25em solid #000; } .center { text-align: center; } .pointer { cursor: pointer; } .right { text-align: right; } +.rank-pad { padding-left: 0.3em; padding-right: 0.2em;} .small-no-wrap { white-space: nowrap; width: 1%; } .callout { border: 1px solid transparent; margin-bottom: 0.5em; padding: 0.5em; } diff --git a/trivia/templates/index.html b/trivia/templates/index.html index 713aa9e..7e4c18f 100644 --- a/trivia/templates/index.html +++ b/trivia/templates/index.html @@ -34,11 +34,11 @@ - - + + {% for i in range(scoreCount) %} - + {% endfor %}
RankIDRankID Team Name{{ i + 1 }}{{ i + 1 }}