Hide stats footer by default and collapse elevation chart if needed

This commit is contained in:
Gautier P 2020-05-25 20:19:30 +02:00
parent 341ba4f7a5
commit bbaad4f8b3
2 changed files with 10 additions and 5 deletions

View file

@ -83,16 +83,16 @@ footer {
}
#stats-container {
display: flex;
display: none;
}
#stats-container[style*='display: block'] {
display: flex !important;
}
#stats-info {
align-items: center;
height: 46px;
display: none;
}
#stats-info[style*='display: block'] {
display: flex !important;
display: flex;
}
#stats-info > div {
margin: auto;

View file

@ -3,11 +3,16 @@ BR.TrackStats = L.Class.extend({
if (segments.length == 0) {
$('#stats-container').hide();
$('#stats-info').show();
this.shouldRestoreChart = $('#elevation-chart').hasClass('show');
$('#elevation-chart').collapse('hide');
return;
}
$('#stats-container').show();
$('#stats-info').hide();
if (this.shouldRestoreChart === true) $('#elevation-chart').collapse('show');
this.shouldRestoreChart = undefined;
var stats = this.calcStats(polyline, segments),
length1 = L.Util.formatNum(stats.trackLength / 1000, 1).toLocaleString(),
length3 = L.Util.formatNum(stats.trackLength / 1000, 3).toLocaleString(undefined, {