From f1c451bafb2dd4a3c61cbb2072b5d5ffe5726842 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Fri, 6 May 2022 04:06:16 -0700 Subject: web: move scroll ellipses to CSS where they belong --- web/static/style.css | 1 + web/web_scoreboard.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'web') diff --git a/web/static/style.css b/web/static/style.css index 51dac74..9eeb337 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -371,6 +371,7 @@ div#visits .p100 { color: #78c018; } div#visits .p140 { color: #20e018; } div#visits .p180 { color: #20e018; font-weight: bold; } div#visits .visit-col6 { color: #666; justify-content: left; font-family: monospace; white-space: pre; } +div#visits .visit-col6:not(:empty):before { content: '…'; } .modal { background-color: #000a; diff --git a/web/web_scoreboard.c b/web/web_scoreboard.c index d0a5947..6207d4a 100644 --- a/web/web_scoreboard.c +++ b/web/web_scoreboard.c @@ -212,15 +212,15 @@ void draw_visits() "visit-col5", points_class(v->points)); elemv[elemc++] = create_div(buf, buf2); - char *pbuf = stpcpy(buf, "…"); - for (int j = 0; j < v->n_darts; ++j) { - char *n = segment_name(v->darts[j]); - snprintf(pbuf + (j * 5), - sizeof(buf) - (pbuf + (j * 5) - buf), - " %4s", n); - free(n); + if (v->n_darts) { + for (int j = 0; j < v->n_darts; ++j) { + char *n = segment_name(v->darts[j]); + snprintf(buf + (j * 5), sizeof(buf) - (j * 5), + " %4s", n); + free(n); + } + elemv[elemc++] = create_div(buf, "visit-col6"); } - elemv[elemc++] = create_div(buf, "visit-col6"); } dom_append_elemv("#visits", elemc, elemv); -- cgit v1.2.3-70-g09d2