From 52be57f5ba9895e5bf997ba3e30eb5547386f72f Mon Sep 17 00:00:00 2001 From: Gautier P Date: Sun, 24 May 2020 15:35:56 +0200 Subject: [PATCH 1/3] Always display 3 digits for distance title, even when ending with zeros --- js/control/TrackStats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/control/TrackStats.js b/js/control/TrackStats.js index 41c75b0..355b551 100644 --- a/js/control/TrackStats.js +++ b/js/control/TrackStats.js @@ -15,7 +15,9 @@ BR.TrackStats = L.Class.extend({ var stats = this.calcStats(polyline, segments), length1 = L.Util.formatNum(stats.trackLength / 1000, 1).toLocaleString(), - length3 = L.Util.formatNum(stats.trackLength / 1000, 3).toLocaleString(), + length3 = L.Util.formatNum(stats.trackLength / 1000, 3).toLocaleString(undefined, { + minimumFractionDigits: 3 + }), formattedAscend = stats.filteredAscend.toLocaleString(), formattedPlainAscend = stats.plainAscend.toLocaleString(), formattedCost = stats.cost.toLocaleString(), From a358aed464061e79da35dfb7a42b5f4ae82b6706 Mon Sep 17 00:00:00 2001 From: Gautier P Date: Sun, 24 May 2020 19:20:45 +0200 Subject: [PATCH 2/3] Improve stats footer on mobile #296 --- css/style.css | 45 ++++++++++++++++++++++++++++--------- index.html | 48 +++++++++++++++++++++++++--------------- js/control/TrackStats.js | 13 ++++------- locales/en.json | 1 + 4 files changed, 70 insertions(+), 37 deletions(-) diff --git a/css/style.css b/css/style.css index ea11721..cf015bd 100644 --- a/css/style.css +++ b/css/style.css @@ -79,30 +79,53 @@ table.dataTable { footer { flex: none; - background-color: #f7f7f9; } +#stats-container { + display: flex; +} + +#stats-info { + align-items: center; + height: 46px; + display: none; +} +#stats-info[style*='display: block'] { + display: flex !important; +} +#stats-info > div { + margin: auto; +} #stats { flex-grow: 1; margin: 0; padding: 0; text-align: center; } -#stats li { - margin: 0 1rem; - display: inline-block; + +ul#stats { + display: flex; + align-items: stretch; + justify-content: space-around; + width: 100%; + margin: 0; + padding: 0; } +#stats li { + display: inline-block; + flex: 0 1 auto; + list-style-type: none; +} + +p.stats-label { + margin-bottom: 0.2em; +} + @media (max-width: 767px) { - #stats li { - margin: 0 0.5rem; - } #stats { padding-top: 0.4em; } - p.stats-label { - margin-bottom: 0.4em; - } } .stats-label { @@ -162,6 +185,8 @@ input#trackname:focus:invalid { #elevation-btn { align-items: center; margin-right: 0.5rem; + height: max-content; + align-self: center; } .routing-draw-enabled { diff --git a/index.html b/index.html index 50dcf0a..31fb2d2 100644 --- a/index.html +++ b/index.html @@ -772,43 +772,50 @@