Client - fix display when workout has no evelation data
This commit is contained in:
parent
c409f2cbab
commit
62f3940e7d
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="workout-data"
|
class="workout-data"
|
||||||
:class="{ 'without-gpx': workout && !workout.with_gpx }"
|
:class="{ 'without-elevation': !hasElevation(workout) }"
|
||||||
@click="
|
@click="
|
||||||
workout.id
|
workout.id
|
||||||
? $router.push({
|
? $router.push({
|
||||||
@ -92,7 +92,7 @@
|
|||||||
:useImperialUnits="useImperialUnits"
|
:useImperialUnits="useImperialUnits"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="data elevation" v-if="workout && workout.with_gpx">
|
<div class="data elevation" v-if="hasElevation(workout)">
|
||||||
<img
|
<img
|
||||||
class="mountains"
|
class="mountains"
|
||||||
src="/img/workouts/mountains.svg"
|
src="/img/workouts/mountains.svg"
|
||||||
@ -114,7 +114,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="data altitude" v-if="hasElevation(workout)">
|
<div class="data altitude" v-if="hasUphillValue(workout)">
|
||||||
<i class="fa fa-location-arrow" aria-hidden="true" />
|
<i class="fa fa-location-arrow" aria-hidden="true" />
|
||||||
<div class="data-values">
|
<div class="data-values">
|
||||||
+<Distance
|
+<Distance
|
||||||
@ -169,7 +169,16 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
function hasElevation(workout: IWorkout): boolean {
|
function hasElevation(workout: IWorkout): boolean {
|
||||||
return workout && workout.ascent !== null && workout.descent !== null
|
return (
|
||||||
|
workout.with_gpx && workout.min_alt !== null && workout.max_alt !== null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
function hasUphillValue(workout: IWorkout): boolean {
|
||||||
|
return (
|
||||||
|
hasElevation(workout) &&
|
||||||
|
workout.ascent !== null &&
|
||||||
|
workout.descent !== null
|
||||||
|
)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -273,7 +282,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.without-gpx {
|
&.without-elevation {
|
||||||
.img,
|
.img,
|
||||||
.data {
|
.data {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user