Improve hiding elevation chart when empty
Consider additional cases: - flag got reset when deleting and adding first waypoint - don't show empty on load, postpone to update - don't store state when hidden because empty
This commit is contained in:
parent
b701a6f298
commit
2df1f617c9
2 changed files with 11 additions and 6 deletions
|
|
@ -3,15 +3,11 @@ 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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue